提交时间:2024-01-25 21:12:19
运行 ID: 128601
#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; }