|
|
back to boardHelp! I am quite sure this should work but it gets WA. WHY?!!! My Email : caa@baga.ac.net.ru =-=-=-=-= Program acm_1126; Var A : array [1..25000] of longint; G : array [0..400,0..299] of longint; Nums : array [0..400] of longint; i,j,k : longint; M,N : longint; Begin FillChar(G,sizeOf(G),0); FillChar(Nums,sizeOf(Nums),0); Read(M); i:=0; N:=0; While i<>-1 do BegiN Read(i); If i<>-1 then Begin Inc(N); A[N]:=i; End; End; For i:=1 to N do Begin j:=A[i] div 300; k:=A[i] mod 300; Inc(G[j,k]); Inc(Nums[j]); If i>M then Begin j:=A[i-M] div 300; k:=A[i-M] mod 300; Dec(G[j,k]); Dec(Nums[j]); End; If i>=M then Begin k:=400; While Nums[k]=0 do Dec(k); j:=299; While G[k,j]=0 do Dec(j); writeln(300*k+j); End; End; End. Re: Help! I am quite sure this should work but it gets WA. WHY?!!! Posted by Tony 6 Jun 2003 15:46 Read this program more clear again! Oh believe me I ve read it tens of times. And I just cant figure out how it doesnt get AC... 8-( [HEEEEEELP!!!] |
|
|