|
|
вернуться в форумWhy I got WA?Help me! Here is my program:program Space; var L, R, I, J, K : longint; s : array [1.. 1000] of longint; begin readln (L); if L < 2 then R := 0; for I := 1 to 1000 do s [I] := 0; if L > 1 then begin I := 2; J := 2; s [1] := 2; R := 1; repeat if L > J then begin inc (R); s [R] := I; if R > 3 then inc (s [R]); I := J + 1; J := (I + 2 - s [R]) * s [R] - 2; end; until L <= J; end; writeln (R); for I := R downto 1 do writeln (s [I]); end. Re: Why I got WA?Help me! As for me - I don't try to create solution by "jumps". I go from 2 to N and some times add i/2+1 to answer. |
|
|