Can anyone explain the difference?

Правка en1, от FThiesen, 2019-12-19 16:35:55

Hi!

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

https://mirror.codeforces.com/contest/1266/submission/67209030

https://mirror.codeforces.com/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?

Теги cpp

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский FThiesen 2019-12-19 16:41:26 0 (published)
en3 Английский FThiesen 2019-12-19 16:39:42 170
en2 Английский FThiesen 2019-12-19 16:36:13 2 Tiny change: 's one...\n~~~~~\nl' -> 's one...\n\n~~~~~\nl'
en1 Английский FThiesen 2019-12-19 16:35:55 693 Initial revision (saved to drafts)