-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRSIGNS.cpp
60 lines (51 loc) · 1.15 KB
/
RSIGNS.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <bits/stdc++.h>
using namespace std;
long long t,j,n,mod=1000000007;
set<long long > s;
long long power(long long x, long long y)
{
long long res = 1;
while (y > 0)
{
// If y is odd, multiply x with result
if (y & 1)
res = res*x;
res%=mod;
// n must be even now
y = y>>1; // y = y/2
y%=mod;
x = x*x; // Change x to x^2
x%=mod;
}
res%=mod;
return res;
}
int main(){
int t;
cin>>t;
while(t--){
cin>>n;
/*long long cnt=0;
for(long long i=0;i<pow(10,n);i++){
j=i;
while(j>0){
s.insert(j%10);
j/=10;
}
j=pow(10,n)-i-1;
while(j>0){
s.insert(j%10);
j/=10;
}
if(s.size()==2){
//cout<<i<< " "<<pow(10,n)-i-1<<endl;
cnt++;
}
s.clear();
}
cout<<"Cnt : "<<cnt+2<<endl;*/
long long ans=10*power(2,n-1);
cout<<ans%mod<<endl;
}
return 0;
}