Submission #154696

#TimeUsernameProblemLanguageResultExecution timeMemory
154696junodeveloperGreat Pow! (kriii1_G)C++14
0 / 1
2 ms384 KiB
#include <bits/stdc++.h> #define sz(x) ((int)x.size()) #define all(x) (x).begin(), (x).end() #define fi first #define se second using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; int modpow(int a, long long n, int mod) { int r = 1, b = a; while(n > 0) { if(n & 1) r = 1ll * r * b % mod; b = 1ll * b * b % mod; n >>= 1; } return r; } int Pow(int a,int n) { if(n==0) return a; int h=Pow(a,n/2); h=modpow(h,h,a+1); if(n&1) h=modpow(a,h,a+1); return h; } int a,k; int main() { scanf("%d%d",&a,&k); printf("%lld",Pow(a,k+1)); return 0; }

Compilation message (stderr)

G.cpp: In function 'int main()':
G.cpp:30:26: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int' [-Wformat=]
  printf("%lld",Pow(a,k+1));
                ~~~~~~~~~~^
G.cpp:29:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&a,&k);
  ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...