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

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
Posted by Vladimir Yakovlev (USU) 27 Apr 2006 11:34
I use
const double PI = 3.1415...
Re: Pruning appeared to be very effective here. But I have a question (+)
Posted by c0der 28 Apr 2006 21:51
const double Pi = acos(-1.0);
Re: Pruning appeared to be very effective here. But I have a question (+)
Posted by whywaidontknow 19 Aug 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 (+)
Posted by svr 7 Nov 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