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 1510. Order

why acces violation in #17
Posted by Sahil 9 Nov 2008 00:26
var
max,ll,o,i,j,l,m,n:longint;
k:real;
b,a:array[1..1000] of real;
begin
readln(n);
for i:=1 to n do
begin
read(k);
j:=j+1;
a[j]:=trunc(k);
end;
J:=0;
repeat
j:=j+1;
for i:=1 to n do
if a[j]=a[i] then  l:=l+1;
o:=o+1; b[o]:=l;
l:=0;
until j=n;
max:=trunc(b[1]);
ll:=1;
for i:=1 to o do
if b[i]>max then begin max:=trunc(b[i]);ll:=i; end;

write(a[ll]);
end.
Re: why acces violation in #17
Posted by lazarenko_al [SESC UFU] 18 May 2013 17:59
b,a:array[1..1000] of real!!
increase the size from 1000 to 100000.
But now with this correction TLE