#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
int Max=19;
LL fun(LL x,LL n)
{
LL res=1;
while(n>0)
{
if(n & 1)
res=(res*x)%Max;
x=(x*x)%Max;
n >>= 1;
}
return res;
}
int main()
{
int n;
cin>>n;
cout<<fun(3,n)<<endl;
return 0;
}
3的n次幂 mod 19
最新推荐文章于 2021-10-28 21:20:32 发布