#include <iostream>
using namespace std;
#define mod 1000000007
long long int fast_pow(int x,int us){
if(us==1){return x%mod;}
int mid=us/2;
long long a=fast_pow(x,mid)%mod;
if(us%2==0) return (a*a)%mod;
return (a*a*x)%mod;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;cin>>t;
while(t--){
int x;cin>>x;
if(x==1){
cout<<2<<"\n"<<-1<<"\n";
continue;
}
cout<<fast_pow(2,x-1)%mod<<"\n"<<-1<<"\n";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |