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

Common Board

can anyone give me some tests for 1190? I always get wa on test 7thanks
Posted by liuzhizhi 31 Jul 2004 07:07
above
var
  n,j:integer;
 total:real;
  t:array[1..5000]of shortint;
  v:array[1..5000]of longint;
procedure init;
 var
  I,b,j:integer;
  a:char;
  c:longint;
 begin
  readln(N);
  for i:=1 to n do
   begin
    read(a);
    while a=' ' do read(a);
    while a<>' ' do read(a);
    read(b);
    if b=1 then
     begin
      read(c);
      v[i]:=c;
      t[i]:=1;
      for j:=1 to i-1 do
       if t[j]=0 then
        begin
         total:=total+c;
         t[j]:=1;
         v[j]:=c;
        end else
        if t[j]=1 then
         begin
          if c>v[j] then
           begin
            write('NO');
            halt;
           end;
         end;
      total:=total+c;
     end else t[i]:=0;
    readln;
   end;
 end;

begin
 init;
 if total>10000 then write('NO') else write('YES');
end.

Edited by author 31.07.2004 07:07

Edited by author 01.08.2004 08:25
Re: can anyone give me some tests for 1190? I always get wa on test 7thanks
Posted by Sandro (USU) 31 Jul 2004 15:30
Try this:
3
a 1 5000
b 0
c 1 2000

The correct answer is YES.

Good luck!

Edited by author 31.07.2004 15:31
Re: can anyone give me some tests for 1190? I always get wa on test 7thanks
Posted by liuzhizhi 1 Aug 2004 08:26
Thanks.
I have already fixed my program but also get wa.
can anyone help me?
Re: can anyone give me some tests for 1190? I always get wa on test 7thanks
Posted by Sandro (USU) 1 Aug 2004 12:08
And what about this test?
2
a 1 4000
b 0

The correct answer is NO.

Hint: you should calculate both minimum and maximum possible sum of percentage. But you calculate only one of them.
Re: can anyone give me some tests for 1190? I always get wa on test 7thanks
Posted by zhizhiliu 9 Aug 2004 14:42
I know
thanks.