|
|
back to boardWhy I got WAЈїЈїЈїЈїЈїЈїЈї Posted by qwt 25 Apr 2002 18:49 var a:array[0..14000] of longint; b:array[-1..200000] of longint; n,i,j,k,max:longint; begin read(n); fillchar(a,sizeof(a),0);fillchar(b,sizeof(b),0); b[- 1]:=10000;max:=-1; for i:=0 to n-2 do begin read(a[i]); if a[i]=-1 then begin writeln(max);halt;end; inc(b[a[i]]); if a[i]>max then max:=a[i]; end; read(j); while j>=0 do begin inc(i); i:=i mod n; dec(b[a[i]]);a[i]:=j; inc(b[j]); if j>max then max:=j; while b[max]<=0 do dec(max); writeln(max); read(j); end; end. Re: Why I got WAЈїЈїЈїЈїЈїЈїЈї Because first chislo is m (don't n) Edited by author 17.10.2010 00:31 Edited by author 17.10.2010 00:31 |
|
|