openjudge 百练4010
openjudge打不开惹
先贴个代码qaq
1 #include<cstdio> 2 #include<iostream> 3 #define ll long long 4 using namespace std; 5 const int m = 10000; 6 ll n; 7 int t; 8 int main() { 9 scanf("%d", &t); 10 while(t--) { 11 scanf("%lld", &n); 12 ll ans = 1; 13 int a = 2011; 14 while(n>0) { 15 if(n&1) ans = ans*a%m; 16 a = a*a%m; 17 n = n>>1; 18 } 19 ans %= m; 20 cout<<ans<<endl; 21 } 22 return 0; 23 }