I'm glad to invite everybody to take part in the current round.
Today the problems' author is me. I with Artem Rakhov, Maria Belova and Dmitry Matov have tried to do everything possible to make problems more reliable.
I hope that the problems will be interesing for you, the contest will be dinamical, and stronger competitors will cope with the problems quickly to help newcomers to catch all bugs by their hacks :)
Good luck!
P.S. The phrase "stronger competitors will cope with the problems quickly" in no way means that all the problems will be easy. Don't forget to read statements and to test your solutions!
UPD. The contest is over. Congratulations to the winner - Kenny_HORROR!
UPD2. Tutorial is added. In spite of the record number of participants the system has been working stable during the round. Thanks to Codeforces team! Also thanks to everyone who took part in the round.
int ron = -1;
int val[] = {e, f, a, b, c, d};
for (int i = 5; ron == -1 && i >= 0; i--)
if (val[i] == 0)
ron = (i & 1) == 0;
if (ron == -1)
ron = b * d * f > a * c * e;
printf("%s\n", ron ? "Ron" : "Hermione");
I don't know if it is easy,but my last idea (which got accepted) was just to simulate the process of transformations:
double process(double x,int a,int b)
{
if(a==0 && b==0)return 0;
if(a!=0 && b!=0)return x*b/a;
if(a==0 && b!=0)return 1e+100;
if(a!=0 && b==0)return 0;
}
t0=c,c>0
then t1=process(t0,a,b);t2=process(t1,c,d);t3=process(t2,e,f).
if we have a lot of gold after 2-nd step(t2>1e+50),or more sand then it was before after the 3-rd step(t3>t0),then Output=Ron
double p=1e20,ng,pg;
for(i=0;i<5;i++) {
j=i%3;
if(fm[j]==0) {
if(to[j]) {p=pow(10,k);k+=20;}
else p=0;
}
else p=(p*to[j])/fm[j];
if(i==1) pg=p;
else if(i==4) ng=p;
}
if(ng>(pg+1e-6)) puts("Ron");
else puts("Hermione");
2. Submit A.
3. Lock A.
4. Realize A is wrong.
5. Hack all the wrong submissions of A.
6. Don't be able to write even B!
7. Solve 0 probs, make some hacks, ... +24 to global rating. o_O
8. ????????
9. PROFIT
Fuck Yeah)))
(P.S. My algorithm is a little bit different; I employed equation-solving approach whereas many others used binary search.)
To my understanding, the point is that, different quantities (e.g., parameter in segment, time, angle in radiance, length, area, ...etc) have DIFFERENT ORDER of magnitudes. If the test data are sensitive to precision, making a "correct" choice of EPSILON could be difficult. (Or even, I would say, it requires luck.)
Some problems (in various contests) will state explicitly that, you may assume that small precision problem will not affect the solution. But it seems not the case here...
I guess (and I hope) problem setters do not intend to include estimating good values of EPSILON as a part in Problem C. I am not blaming the problem/test setters, and in fact this problem is well set and interesting. But I hope that next time they could take care of this issue.
Please share with us if you have any insights. I suspect quite many algorithm coders, including me, find precision problem annoying before...
First examine the second rule, then the first and the third ones.
If c is 0 but d isn't, it means you can gain gold by no cost. => R
If d is 0, no matter what c is, it means you can never gain gold. => H
If c and d aren't 0, in the same way to think about first and third rules.
If a is 0 but b isn't / e is 0 but f isn't, it means we have infinite resource. => R
If b / f is 0, no matter what a / e is, it means that our resource will be exhausted. => H
Finally, if no number is 0, it's just an easy math problem.
It seems that many people gain lots of hacking score by problem A.
It contains some basic consideration in our daily life.
We should just calm down to think about it, instead of being nervous or careless and then promiscuously guessing the answer.
Input Mine Answer
5
1901 1001
1166 1066
1308 1108
1037 1137
1808 1208
Correct Output:
No solution
tl;dr: great job, organizers! I definitely look forward to the next match.