|
|
вернуться в форумWhy WA1??? program z1026; var n,k,i,j,nomer:integer; count:array[1..5000]of integer; a,rez:array[1..100000]of integer; z:array[1..100]of integer; s:string; begin read(n); for i:=1 to n do read(a[i]); read(s); read(k);
for i:=1 to 5000 do count[i]:=0; for i:=1 to n do inc(count[a[i]]); nomer:=1; for i:=1 to 5000 do for j:=1 to count[i] do begin rez[nomer]:=i; inc(nomer); end; for i:=1 to k do read(z[i]); for i:=1 to k do writeln(rez[z[i]]); end. Answer for test1 is 121 121 7 123 |
|
|