I have tried to use accumulate STL function for long long int data type. But it is showing garbage value in my compiler. But it works for int data type properly.
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
//vector<ll>v={1,2,3,4};
vector<ll>v={10000000000,2,3,4};
cout<<accumulate(v.begin(),v.end(),0);
return 0;
}
It shows right output for the commented line. Is there any problem with long long int?