|
|
вернуться в форумTLE test 28??? Hey, Can anyone tell me what is test 28?? I have time limit exceeded? This is my code: program Monobilliards_1494; var tmp, b, a, i, n: LongInt; x: array [1..100000] of LongInt; cheater: boolean; begin cheater := false; readln(n); for i := 1 to n do readln(x[i]); i := 1; tmp := x[1] - 1; while (i <= n) and not cheater do begin if tmp < x[i] then begin b := x[i] - i; tmp := x[i]; a := i + 1; while (a <= n) and (b > 0) do begin if tmp > x[a] then begin b := b - 1; tmp := x[a]; end; a := a + 1; end; end; tmp := x[i]; if b > 0 then cheater := true; i := i + 1; end; if cheater then writeln('Cheater') else writeln('Not a proof'); end. |
|
|