-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPOW.cpp
More file actions
33 lines (31 loc) · 658 Bytes
/
POW.cpp
File metadata and controls
33 lines (31 loc) · 658 Bytes
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
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define EPS 0.00000001
#define PI 2*acos(0.0)
#define Fout freopen("output.txt","w",stdout)
#define Fin freopen("input.txt","r",stdin)
#define MS(ARRAY,VALUE) memset(ARRAY,VALUE,sizeof(ARRAY))
#define RT printf("Run Time : %0.3lf seconds\n", clock()/(CLOCKS_PER_SEC*1.0))
template <class X> X ipow(X base, X exp)
{
X result = 1;
while (exp)
{
if (exp & 1)
result *= base;
exp >>= 1;
base *= base;
}
return result;
}
int main()
{
LL a,b;
while(1)
{
cin>>a>>b;
cout<<ipow(a,b)<<endl;
}
return 0;
}