提交时间:2024-01-25 10:32:42

运行 ID: 127830

#include <bits/stdc++.h> using namespace std; #define LL long long const int N = 1e5 + 10; const int 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; }