fork download
  1. #include<iostream>
  2. #include<math.h>
  3. using namespace std;
  4.  
  5. #define ll long long
  6. const int MOD = 1e9+7;
  7.  
  8. ll power(ll a, ll b)
  9. {
  10. if(b == 1)
  11. return a%MOD;
  12. return ((power(a, b-1)%MOD)*(a%MOD))%MOD;
  13. }
  14.  
  15. int main()
  16. {
  17. ios_base::sync_with_stdio(false);
  18. cin.tie(NULL);cout.tie(NULL);
  19. ll a, b;
  20. cin >> a >> b;
  21. cout << power(a, b);
  22. }
Runtime error #stdin #stdout 1.69s 2095896KB
stdin
Standard input is empty
stdout
Standard output is empty