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

Обсуждение задачи 1376. Пирамида декана 2

Pruning appeared to be very effective here. But I have a question (+)
The statement "in the case of tie, you also have to minimize the number of rolls" is ambiguous. There might be a situation when using more rolls we can win (for instance) 1E-8 of distance. I had problems in understanding what should I do in such case and finally fell to EPS=1E-4 while updating the result. Is it correct or the tests are just weak?

P.S. I am learning C++, and I had a problem with pi. We have M_PI in BCC and VCC, but not in ICL. I had to declare "const double PI = 3.14159265358979323846" (extracted from math.h of VCC). Does anybody know what constant for pi is used in ICL?

Edited by author 26.04.2006 22:56
Re: PI
Послано Vladimir Yakovlev (USU) 27 апр 2006 11:34
I use
const double PI = 3.1415...
Re: Pruning appeared to be very effective here. But I have a question (+)
Послано c0der 28 апр 2006 21:51
const double Pi = acos(-1.0);
Re: Pruning appeared to be very effective here. But I have a question (+)
Послано whywaidontknow 19 авг 2007 12:18

#define USE_MATH_DEFS
#define _USE_MATH_DEFINES
#include <math.h>

const double PI = M_PI;
Re: Pruning appeared to be very effective here. But I have a question (+)
Послано svr 7 ноя 2009 10:33
I got Ac using convertion:
__int64 RRec=10000*(double)Rec;
if (RRec%10>4) RRec=RRec-RRec%10+10;
else RRec=RREc-RRec%10;
and
Rec=RREc;
Rec=Rec/10000;
But I am not sure that it so important