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

Обсуждение задачи 1836. Вавилонская рыбка

Test #2
Послано Vitaliy Karelin 30 апр 2011 15:52
What's wrong with this test?
Re: Test #2
Послано Ronnie 30 апр 2011 21:13
i have the same question. what's the catch?

and what's with the "ambiguous" case? how can it be ambiguous?
Re: Test #2
Послано AterLux 1 май 2011 02:14
When tank angled too much, one or more of sensors will show 0.
If 3 or 2 neighboring sensors shows 0, then you cant determine the angle, but at whole data is not erroneous, so you shall output "ambiguous"

for exampe
10 0 1 1 0  - ambiguous
10 0 1 0 1  - error
10 0 0 0 0  - 0.0
10 0 1 3 1  - 104.166667 (not error!)
10 0 1 3 2  - 150.0
10 0 1 5 3  - 202.083333
10 0 1 3 5  - error






Edited by author 01.05.2011 03:36
Re: Test #2
Послано bsu.mmf.team 1 май 2011 02:33
OMG, my program passed all these tests, but still WA#2. Do you have any other tricky tests?
Re: Test #2
Послано AterLux 1 май 2011 02:40
I don't know ;)
naive o^2 * (h1 + h2 + h3 + h4) / 4 will pass test #2 (with checking erroneous data preliminarily of course) and will WA only at #3
try swap data, like this:
10 0 1 3 2
10 2 0 1 3
10 3 2 0 1
10 1 3 2 0
etc.

Edited by author 01.05.2011 02:41
Re: Test #2
Послано bsu.mmf.team 1 май 2011 03:03
Of course, I considered this case. Now I have WA#4. This test helped me a little:
1000000 1000000 1000000 1000000 1000000 -> 1000000000000000000.000
I guess, there are exists such tests, where, while calculating the volume, the itermediate calculations exceed 2^64. The reason of WA seems to be this.
P.S. Don't like Java :)
Re: Test #2
Послано sklyack 5 май 2011 16:25
bsu.mmf.team, did you find the mistake? What is it?

Edited by author 05.05.2011 16:26
Re: Test #2
Послано AterLux 5 май 2011 18:36
I've used extended (in Pascal) to perform all calculations. But I think precision of double also enough to perform it, because required "relative error of at most 10^6".

I hope you're not using integers of any size to perform real-number calculations? ;)

---

I've just sent my solution replacing extended to double - it still have AC.
But when I replaced it again to single (Pascal) - I got WA #4.

So, if you using float (in Java) you have to replace it with double

Edited by author 05.05.2011 18:40
Re: Test #2
Послано bsu.mmf.team 6 май 2011 19:27
Yes, I found my mistake. I got AC after I changed my function, which checks if 4 points lie on the same plane. I rewrote it using only integer calculations.
Re: Test #2
Послано kaysar_buet08 30 июн 2011 10:29
what the wrong with test case  2 ,passing all of the forum :(.help pls..!!
Re: Test #2
Послано svr 25 окт 2011 10:45
Friend! Your swapping-advice very right but very very dangerous!
My ideal AC program had 12 lost submissions due bad swapping.
Example: 0 1 3 2 -> 3 1 0 2- good.
1 0 3 2 -> 1 3 0 2 - bad! But double swapping swap(y2,y3),swap(y1,y4)
1 0 3 2 ->2 3 0 1 - right again!

P.S.
Why 1 0 3 2 -> 1 3 0 2 - bad? In 1,0,3,2 we have ciclic  3>2>1>0
but in 1,3,0,2 this invariant killed ,nature of data changed.

Edited by author 25.10.2011 11:07