|
|
back to boardhelp!!WA10 what's wrong? program t1688; var h:array [1..3000] of int64; a,p:int64; n,m:int64; b,i,j:longint; begin readln(a,b); for i:=1 to b do readln(h[i]); for i:=1 to b-1 do for j:=b downto i+1 do begin if h[i]>h[j] then begin p:=h[i]; h[i]:=h[j]; h[j]:=p; end; end; for i:=1 to b do begin m:=m+h[i]; if a*3<m then inc(n); end; if n=0 then writeln('Team.GOV!') else writeln('Free after ',b-n,' times.'); end. Edited by author 16.04.2010 11:37 |
|
|