In CodeForces #243 Div 2 B (something to do with mirroring), I submitted a solution (number is 6543367), and on the 10th test it gives 2 with GNU C++ 4.7 compiler, but on my own computer (Windows 8, gdb 6.8) it gives the correct answer 1.
And then I tried to switch to Microsoft VC++ 2010, and got AC.....
I checked my code twice and did not discover any hazard parts. Is there anyone could explain why? Thanks!
I've edited your solution a bit. 6543599
Problem in
Thank you very much for your attention! Does the solution imply that I should avoid using "log" when compiling with GNU C++?
Code that looks like:
usually bad idea (imho).
Look at this 6543990
Thank you, I will use
instead.
Learnt a lesson today, thank you!
It's also a bad idea. You should avoid using operators == and != together with floating points variables. For example, instead of the code you've provided in the last comment one can write the following:
Here eps should be small enough, e.g. 10 - 9. Actually, its value depends on the problem you are solving.
Thank you, I have known this trick but in that round I was too lazy to write in that way, and it came back to me = =
(Deleted)