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 1502. Domino Dots

What's Wrong With C++
Posted by Alexander Prokazyuk (TKTL) 21 Nov 2006 07:51
I wrote AC solution on C++
but it failed on #5 test.
Then I rewrite this code,
but on Pascal then I got AC
Can anybody tell me why
solutions on C++ fail tests,
but on Pascal it pass easily?!?!?!

P.S.
I'm Sorry For My Bad English

Edited by author 21.11.2006 07:55
Re: What's Wrong With C++
Posted by Midnight_Kitty 23 Nov 2006 14:05
May be your C++ solution wrong?
Re: What's Wrong With C++
Posted by Grab[SSAU] 25 Nov 2006 19:24
May be you need to use __int64 type in your C++ program?
Re: What's Wrong With C++
Posted by Luft-on 23 Apr 2007 17:50
У меня та же проблема! Задача на Паскале проходит все тесты, но переписав на С++, получаю WA 5! Это уму не постежимо!

I have the same problem! Problem writed on Pascal pass all of tests, but only I`ve rewrite it on C++, I`ve get WA 5! It is UNBELIVIBLE!

Edited by author 23.04.2007 17:51

Edited by author 23.04.2007 17:51
Re: What's Wrong With C++
Posted by NightDemon 26 Jan 2008 06:11
long long N;
printf("%lld", N) - works wrong there!

But if I write
printf("%0.lf", (double)N) - everything gets fine.
Still strange to me why it is so.
Re: What's Wrong With C++
Posted by NightDemon 26 Jan 2008 06:19
printf("%I64d", N) - works (I is capital "i")
Re: What's Wrong With C++
Posted by BlindButcher 9 Oct 2008 11:17
use int64 and it will be ok

Edited by author 09.10.2008 11:18

Edited by author 09.10.2008 11:18