Can anyone explain the difference?

Revision en3, by FThiesen, 2019-12-19 16:39:42

Hi!

I have two really similar submissions to problem (https://codeforces.net/contest/1266/problem/E)

https://codeforces.net/contest/1266/submission/67209030 (**WA version**)

https://codeforces.net/contest/1266/submission/67209163 (**AC version**)

The WA version has the following line:

long long ans = accumulate( a.begin(), a.end(), 0, [] (long long a, long long b) { return a + b; } );

With this simple change on this specific line I got it accepted.

long long ans = accumulate( a.begin(), a.end(), 0ll, [] (long long a, long long b) { return a + b; } );

Why the zero of the WA version does not seem to be converted to long long?

Tags cpp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English FThiesen 2019-12-19 16:41:26 0 (published)
en3 English FThiesen 2019-12-19 16:39:42 170
en2 English FThiesen 2019-12-19 16:36:13 2 Tiny change: 's one...\n~~~~~\nl' -> 's one...\n\n~~~~~\nl'
en1 English FThiesen 2019-12-19 16:35:55 693 Initial revision (saved to drafts)