#include #include #include const size_t N = 1 << 25; // 32M int v[N]; // 32M * 4B = 128MB int f1() { return std::accumulate(std::begin(v), std::end(v), 0); } int f2() { return std::accumulate(std::rbegin(v), std::rend(v), 0); } int main() { return f1() + f2(); }