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

Обсуждение задачи 1011. Кондукторы

Need help for problem 1011 : Conductors
Послано Timus Observer 4 сен 2001 20:49
Could someone give me some hints for problem 1011. I can
pass the test case but keep getting WA. Looks like there is
a test case that the program can not pass.
I past the tast case too
Послано Algorist 5 сен 2001 03:33
Here s my algo
i=0
while not found solution do
    i=i+1
    if trunc(i*inputted1)<>trunc(i*inputted2) then found
solution=true
output(i)

That's all. I'm perfectly sure it's correct, I've submitted
it in Pascal as well as in C++, but I got C++(in C++
instead of trunc I use floor). Do you do the same?
pass the tast case too, mistakes corrected
Послано Algorist 5 сен 2001 03:40
Oops, i made some mistakes. I meant
 Here s my algo
 i=0
 while not found solution do
     i=i+1
     if trunc(i*inputted1/100)<>trunc(i*inputted2/100) then
found
 solution=true
 output(i)

 That's all. I'm perfectly sure it's correct, I've
submitted
 it in Pascal as well as in C++, but I got C++(in C++
 instead of trunc I use floor). Do you do the same?
Always WA
Послано Timus Observer 5 сен 2001 06:57
>  That's all. I'm perfectly sure it's correct, I've
> submitted
>  it in Pascal as well as in C++, but I got C++(in C++
>  instead of trunc I use floor). Do you do the same?
I did the same thing but always got WA:
program pr1011_conductors;
var sol : integer;
    pct1, pct2 : real;
    found : boolean;
begin
found:=false;
sol:=0;
read(pct1,pct2);
while not found do
begin
  inc(sol);
  if trunc(sol*pct1/100) <> trunc(sol*pct2/100) then
found:=true;
end;
writeln(sol);
end.
Re
Послано Algorist 5 сен 2001 21:38
HA-HA
My code is EXACTLY the same only the variable names differ
from yours. BUT I haven't been ever more sure that program
is correct. THERE'S JUST NO PLACE TO GET WRONG. So, as
someone said in this forum but stopped helping :
In Pascal, Real TYPE can be round, and it make incorrect.
Use ROUND Function to fix it.
If it still get WA, Call me.

Do you get this? Cause I can't.. Too bad English or what?
Re
Послано Timus Observer 6 сен 2001 08:16
> In Pascal, Real TYPE can be round, and it make incorrect.
> Use ROUND Function to fix it.
> If it still get WA, Call me.
>
> Do you get this? Cause I can't.. Too bad English or what?
I do not understand either. I also have tried with:
trunc(....) - trunc(...) > 1E-15 but still get the same
result.
Re
Послано Alexander 24 сен 2001 23:12
> > In Pascal, Real TYPE can be round, and it make
incorrect.
> > Use ROUND Function to fix it.
> > If it still get WA, Call me.
> >
> > Do you get this? Cause I can't.. Too bad English or
what?
> I do not understand either. I also have tried with:
> trunc(....) - trunc(...) > 1E-15 but still get the same
> result.

Pay attention to the fact that P and Q are STRICT
estimations!