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 1028. Stars

Time limit exceeded #9
Posted by Intro 29 Nov 2008 01:22
why Time limit exceeded?

program P1028;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  x,k,i,n,u:word;
  zx:array[0..32000]of word;
  z:array[0..15000]of word;
begin
{$IFNDEF ONLINE_JUDGE}
assignfile(input,'C:\Интро\Проэкты\EXE/input.txt');
assignfile(output,'C:\Интро\Проэкты\EXE/output.txt');
reset(input);
rewrite(output);
{$ENDIF}
readln(n);
k:=0;
repeat
inc(k);
readln(x);
i:=x;
inc(z[zx[x]]);
repeat
  inc(zx[x]);
  inc(x);
until (x=32001);
until k=n;
for i := 0 to n-1 do  writeln(z[i]);
{$IFNDEF ONLINE_JUDGE}
   close(input);
   close(output);
{$ENDIF}
end.