Can anyone explain the difference?

Revision en1, by FThiesen, 2019-12-19 16:35:55

Hi!

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

https://codeforces.me/contest/1266/submission/67209030

https://codeforces.me/contest/1266/submission/67209163

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; } );

On the AC version, the only change made was this one... ~~~~~ long long ans = accumulate( a.begin(), a.end(), 0ll, [] (long long a, long long b) { return a + b; } ); ~~~~~

Why the first one doesn't seem to store the accumulated value in a 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)