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 1196. History Exam

Help! Why my program got WA at test1???
Posted by Tang RZ 30 May 2004 11:17
var
  total:longint;
  n,m,year:longint;
  a:array [1..15000] of longint;

procedure work(year:longint);
var
  i:integer;
begin
  for i:=1 to n do
    if a[i]>year then break
      else if a[i]=year then inc(total);
end;

procedure init;
var
  i:integer;
begin
  read(n);
  for i:=1 to n do
    read(a[i]);
  read(m);
  for i:=1 to m do
    begin
      read(year);
      work(year);
    end;
end;

procedure print;
begin
  writeln(total);
end;

begin
  init;
  print;
end.
Re: Help! Why my program got WA at test1???
Posted by Tang RZ 16 Jul 2004 09:59
I'v got AC. 0.843s

Edited by author 16.07.2004 10:48
yours wrong
Posted by zolooha2 15 Oct 2004 13:46
your program gets WA with test#1