|
|
back to boardWhy WA? I know I'd probably get Time Limit. But can anyone explain why I m getting WA in this source... Please email : swin@mail2000.ru =-=-=-=-=-=-=-=-=-=-==-=-=-=-=-= Program acm_1126; const maxx=25000; Var A,B :array [1..maxx] of longint; M,N :Integer; i,j,k :Longint; Begin Readln(M); i:=0; k:=0; While i<>-1 do Begin Read(i); If i<>-1 Then Begin Inc(k); A[k]:=i; End; End; N:=k; For i:=1 to N do B[i]:=A[i]; For i:=1 to N do Begin k:=i+1; While (A[i]>A[k])and(k-i<M)and(k<=n) do Begin If A[i]>B[k] then B[k]:=A[i]; Inc(k); End; End; For i:=M to N do Writeln(B[i]); End. |
|
|