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

why wa4? I use radix!
Posted by fender 4 May 2008 21:15
It works allright, I tested it on many test. Help me please, my code is here.
{$apptype console}
var a: array [1..5000] of longint;
    rez: array [1..150000] of longint;
    i, j, k, n, m, x: longint;
    s: string;
begin
{ reset(input, 'input.txt');
 rewrite(output, 'output.txt');
} readln(n);
 for i:=1 to n do
 begin
  readln(x);
  inc(a[x]);
 end;
 m:=0;
 for i:=1 to 123 do
 begin
  for j:=1 to a[i] do
  begin
   inc(m);
   rez[m]:=i;
  end;
 end;
 readln(s);
 readln(k);
 for i:=1 to k do
 begin
  readln(x);
  writeln(rez[x]);
 end;
{ close(input);
 close(output);
}end.

p.s. excuse me for my bad english =)