Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

fgt's blog

By fgt, history, 2 months ago, In English,

Hi!

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

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

https://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?

Read more »

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