Description
Input
Output
Sample Input
2
Sample Output
2
Data Constraint
做法:打标可以发现这道题是结论题,答案为2^(n-1),所以快速幂就好了。
#include <cstdio>
#include <cmath>
#include <iostream>
#include <cstring>
#define LL long long
#define mo 1000000007
using namespace std;
LL a,base,p;
LL n; inline LL power(LL b){
a=;
base=a;
p=;
for(;b;b>>=){
if(b&) p=p*a%mo;
a=a*a%mo;
}
return p;
} int main(){
scanf("%lld",&n);
printf("%lld", power(n-));
}