ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1376. Dean's Pyramid 2

Show all messages Hide all messages

Pruning appeared to be very effective here. But I have a question (+) Dmitry 'Diman_YES' Kovalioff - IBM is short, Pascal is forever! 26 Apr 2006 22:55
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 Apr 2006 11:34
I use
const double PI = 3.1415...
const double Pi = acos(-1.0);

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

const double PI = M_PI;
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