ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1494. Monobilliards

TLE test 28???
Posted by FreezingCool 7 Jan 2009 21:46
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.
Re: TLE test 28???
Posted by Oleg Strekalovsky [Vologda SPU] 18 Mar 2009 19:50
n^2