|
|
back to boardcan anyone give me some tests? Posted by qwt 3 Apr 2002 20:00 var a:array[0..14000] of integer; b:array[0..25000] of integer; n,i,j,k,max:integer; begin readln(n); fillchar(a,sizeof(a),0);fillchar(b,sizeof(b),0); b[0]:=1;max:=0; for i:=0 to n-2 do begin readln(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; readln(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; k:=max; if b[max]=0 then for max:=k-1 downto 0 do if b[max]>0 then break; writeln(max); readln(j); end; end. Re: can anyone give me some tests? for 3: 108900 and for 4: 598950 Re: can anyone give me some tests? Excuse me !! This are some tests for 1206 . --------------------------------------------- Here is a "good" test for 1126 : Input : 5 0 1 2 3 4 5 6 7 8 9 10 10 9 8 7 6 5 4 3 2 1 10 11 12 0 0 0 0 0 1 2 10 2 -1 Output : 4 5 6 7 8 9 10 10 10 10 10 10 9 8 7 6 5 10 11 12 12 12 12 12 0 1 2 10 10 I got the right answer in your test,but still WA Posted by qwt 6 Apr 2002 19:22 > Excuse me !! This are some tests for 1206 . > > --------------------------------------------- > > Here is a "good" test for 1126 : > > Input : > > 5 > 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 10 > 10 > 9 > 8 > 7 > 6 > 5 > 4 > 3 > 2 > 1 > 10 > 11 > 12 > 0 > 0 > 0 > 0 > 0 > 1 > 2 > 10 > 2 > -1 > > > Output : > > 4 > 5 > 6 > 7 > 8 > 9 > 10 > 10 > 10 > 10 > 10 > 10 > 9 > 8 > 7 > 6 > 5 > 10 > 11 > 12 > 12 > 12 > 12 > 12 > 0 > 1 > 2 > 10 > 10 Re: I got the right answer in your test,but still WA Your problem is in the array constraints: b:array[0..25000] of integer; The problem states that the values are between 0 and 100000, so b [100000] does not exist... Re: I got the right answer in your test,but still WA > Your problem is in the array constraints: > b:array[0..25000] of integer; > The problem states that the values are between 0 and 100000, so b > [100000] does not exist... Got AC with this... var a:array[0..14000] of longint; b:array[0..100000] of longint; n,i,j,k,max:longint; begin {The rest is the same} end. Got AC with this... |
|
|