ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Общий форум

can anyone give me some tests for 1190? I always get wa on test 7thanks
Послано liuzhizhi 31 июл 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
Послано Sandro (USU) 31 июл 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
Послано liuzhizhi 1 авг 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
Послано Sandro (USU) 1 авг 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
Послано zhizhiliu 9 авг 2004 14:42
I know
thanks.