You are viewing a single comment's thread. Return to all comments →
int t; cin>>t; while(t--){ unsigned long long int n, sum=1, mod=1000000007; cin>>n; n/=2; sum=(1+8*n*(n+1)*(2*n+1)/3+2*(n)*(n+1)+4*n)%mod; cout<<sum<<endl; }
whats wrong with this code? I m getting last 2 testcases as wrong answer
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #28: Number spiral diagonals
You are viewing a single comment's thread. Return to all comments →
whats wrong with this code? I m getting last 2 testcases as wrong answer