【Luogu3414】SAC#1 - 组合数

2021/11/15 17:10:54

本文主要是介绍【Luogu3414】SAC#1 - 组合数,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

problem

solution

codes

#include<iostream>
#define mod 6662333
using namespace std;
typedef long long LL;
LL dfs(LL a, LL b, LL p){
    if(b==1)return a%p;
    LL t = dfs(a,b>>1,p)%p;
    if(b%2==0)return t*t%p;
    else return t*t*a%p;
}
int main(){  
    LL n;  cin>>n;
    cout<<dfs(2,n-1,mod);
    return 0;
}

 



这篇关于【Luogu3414】SAC#1 - 组合数的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程