HDU 6063
思路:
AC代码:
#include "iostream"
#include "string.h"
#include "stack"
#include "queue"
#include "string"
#include "vector"
#include "set"
#include "map"
#include "algorithm"
#include "stdio.h"
#include "math.h"
#pragma comment(linker, "/STACK:102400000,102400000")
#define ll long long
#define endl ("\n")
#define bug(x) cout<
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define ft (frist)
#define sd (second)
#define lrt (rt<<1)
#define rrt (rt<<1|1)
using namespace std;
const long long INF &#61; 1e18&#43;1LL;
const int inf &#61; 1e9&#43;1e8;
const int N&#61;1e6&#43;100;
const ll mod&#61;1e9&#43;7;ll pow(ll a, ll b){ll ans&#61;1;a%&#61;mod;while(b>0){if(b&1){ans*&#61;a;ans%&#61;mod;}a*&#61;a;a%&#61;mod;b>>&#61;1;}return ans;
}int main(){ll n,m;int T&#61;0;while(cin>>n>>m){cout<<"Case #"<<&#43;&#43;T<<": "<<(pow(n,m)&#43;mod)%mod<<endl;}return 0;
}