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

Обсуждение задачи 1365. Тестирование вычислителя

Strange ???
Послано Antonov Yuri (USU) 4 авг 2005 17:21
Note:

"It means, that each subexpression is always evaluated in
the same way with no dependency on it's entrance into the whole expression."

CURRENT VERSION of Calculator:
Input:
(0)
(0)1
(0)1(0)1
(0)1(0)1(0)
(0)1(0)1(0)1
(0)1(0)1(0)1(0)
Output:
Expression 1 evaluates to: 0
Expression 2 evaluates to: 1
Expression 3 evaluates to: 101
Expression 4 evaluates to: 1010
Expression 5 evaluates to: 10101
Expression 6 evaluates to: 101010

comment : "Leading zeroes excluded"

PREVIOUS VERSION of Calculator:
Input:

(0)
(0)1
(0)1(0)1
(0)1(0)1(0)
(0)1(0)1(0)1
(0)1(0)1(0)1(0)

Output:
Expression 1 evaluates to: 0
Expression 2 evaluates to: 1
Expression 3 evaluates to: 11
Expression 4 evaluates to: 110
Expression 5 evaluates to: 111
Expression 6 evaluates to: 1110

According to the output of the CURRENT VERSION of calculator
!!! evaluation of subexpression depends on context

Am I right ???
Re: Strange ???
Послано Aleksandr Klepinin 4 авг 2005 18:05
The so called CURRENT VERSION of calculator works correctly (where do you see dependency on context? just notice that calculator operates on numbers, not on strings!)

In fact, calculator engine was updated a few days ago. An error was found there. :) That error was concerned with dependency on context (previous version, as it is mentioned above, evaluated 1(0)1 as 11 instead of 101) and it was fixed. Current logic of calculator is more predictable than the previous one.
"An error was found..." I like it :) (+)
Послано Dmitry 'Diman_YES' Kovalioff 4 авг 2005 19:54
If I'm not mistaken last time you've said such output was absolutely correct and advised me to learn calculator logic carefully ;)
Re: Strange ???
Послано Antonov Yuri (USU) 4 авг 2005 22:20
Sorry !!!
I made a foolish mistake !!!
Re: Strange ???
Послано Antonov Yuri (USU) 4 авг 2005 23:24
Thanks for the help !!!