|
|
вернуться в форумHelp!!! Time Limit!!! here is my program var a,b:array[1..100000] of longint; i,k,l,n,m:longint; f1,f2:text; s:string; begin readln(n); for i:=1 to n do readln(a[i]); readln(s); readln(m); for k:=1 to m do readln(b[k]); for k:=1 to n do for i:=2 to n do if a[i]<a[i-1] then begin l:=a[i]; a[i]:=a[i-1]; a[i-1]:=l; end; for i:=1 to m do writeln(a[b[i]]); readln; end. Re: Help!!! Time Limit!!! You should use fast sort buble sort too long qsort fast enough Re: Help!!! Time Limit!!! use hash, no necessary to sort actually. |
|
|