FThiesen's blog

By FThiesen, history, 5 years ago, In English

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 (**WA version**)

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

Full text and comments »

Tags cpp
  • Vote: I like it
  • +1
  • Vote: I do not like it