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 1026. Questions and Answers

What is wrong im my code???
Posted by Swifty 16 Mar 2009 14:00
var hash:array [1..5001] of longint;
    i,j,k,n,m,ch,zap:longint;
    s:string;
begin
  readln(n);
  for i:=1 to n do
    begin
      readln(ch);
      inc(hash[ch]);
    end;
  readln(s);
  readln(k);
  for i:=1 to k do
    begin
      readln(zap);
      for j:=1 to 5000 do
        begin
          if zap<1 then
                     begin
                       writeln(j-1);
                       break;
                     end
                   else zap:=zap-hash[j];
        end;
    end;
end.

WA Test #2....
Re: What is wrong im my code???
Posted by Frankie 27 Nov 2011 18:03
the main thing wrong with your code is it's in pascal :D