Can anyone explain the difference?

Правка en4, от FThiesen, 2019-12-19 16:41:26

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?

Теги 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)