Блог пользователя DarkZero

Автор DarkZero, 12 лет назад, По-английски

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!

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
12 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

I've edited your solution a bit. 6543599

Problem in

double tmp = log((double)(n/x)) / log(2.0);
	if( tmp != int(tmp))
		return false;