You are viewing a single comment's thread. Return to all comments →
This was not the case in C++ if you're using accumulate().
long long int total = accumulate(arr.begin(),arr.end(), 0);
which appears to overflow. I just iterated through the elements in a loop and summed the total instead.
Seems like cookies are disabled on this browser, please enable them to open this website
A Very Big Sum
You are viewing a single comment's thread. Return to all comments →
This was not the case in C++ if you're using accumulate().
which appears to overflow. I just iterated through the elements in a loop and summed the total instead.