提交时间:2024-03-08 13:18:34

运行 ID: 136164

#include<bits/stdc++.h> using namespace std; #define LL long long const int N = 1e5 + 10,INF = 0x3f3f3f3f; LL power(LL a,LL b,LL p){ if(a==0)return 0; if(b==1)return 0; LL ans=1; while(b!=0){ if(b%2 ==1)ans=(ans*a)%p; b/=2; a=(a*a)%p; } return ans%p; } int main () { LL a,b,p; cin >>b; p=1234567; cout << power(2,b-1,p); return 0; }