fork(4) download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll unsigned long long
  4. #define dbg(x) cout<<#x<<" : "<<x<<endl
  5. #define rep(i,a,b) for(int i=(a);i<=(b);i++)
  6. #define inf 1000000000000000000
  7. priority_queue<ll,vector<ll>,greater<int>> qp;
  8. priority_queue<ll> qr;
  9. #define maxn 100005
  10. #define mod 1000000000000000009
  11. #define cnt_ones __builtin_popcount
  12. ll mul(ll a,ll n,ll mo){
  13. ll res = a, ans = 0;
  14. while(n){
  15. if(n%2) ans = (ans+res)%mo;
  16. res = (res+res)%mo;
  17. n/=2;
  18. }
  19. return ans;
  20. }
  21. ll po(ll a,ll n, ll mo){
  22. ll res=a, ans=1;
  23. while(n){
  24. if(n%2) ans=mul(ans,res,mo)%mo;
  25. res=mul(res,res,mo)%mo;
  26. n/=2;
  27. }
  28. return ans;
  29. }
  30. int main(){
  31. // freopen("input.txt","r",stdin);
  32. // freopen("output.txt","w",stdout);
  33. ll phi = 1000000000000000008;
  34. ll tc;
  35. cin>>tc;
  36. while(tc--){
  37. ll fi,se,th;
  38. cin>>fi>>se>>th;
  39. ll dd = po(se,th,phi);
  40. ll answer = po(fi,dd,mod);
  41. cout<<answer<<'\n';
  42. }
  43. return 0;
  44. }
  45. 1
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:45:1: error: expected unqualified-id before numeric constant
 1
 ^
stdout
Standard output is empty