We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int main() {
int t;
cin>>t;
while(t--)
{
unsigned long long int n;
cin>>n;
n=n%m;
cout<<(n*n)%m<
}
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
return 0;
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Summing the N series
You are viewing a single comment's thread. Return to all comments →
thanks i do it like this:)
include
include
include
include
include
define m 1000000007
using namespace std;
int main() {
int t; cin>>t; while(t--) { unsigned long long int n; cin>>n; n=n%m; cout<<(n*n)%m< } /* Enter your code here. Read input from STDIN. Print output to STDOUT */
return 0; }