ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1688. Team.GOV!

help!!WA10
Posted by brian·hbc 13 Apr 2010 11:32
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