麦睿生 • 5个月前
#include<bits/stdc++.h>
#define int long long
#define P 1234567
using namespace std;
int n;
int qpow(int x,int y)
{
int ans=1,b=x;
while(y!=0)
{
if(y&1) ans=ans*b%P;
b=b*b%P;
y>>=1;
}
return ans;
}
signed main(){
scanf("%lld",&n);
if(n==1)
{
printf("1");
return 0;
}
printf("%lld",qpow(2,n-1));
return 0;
}
评论: