标签:long exgcd main turn target ret 模板 using return
注意点:
#include<cstdio> #include<iostream> #define ll long long using namespace std; int n,p; int poww(int a,int b){ ll ans=1,tmp=a; while(b){ if(b&1){ ans*=tmp; ans%=p; } tmp=tmp*tmp; tmp%=p; b>>=1; } return ans; } int main(){ scanf("%d%d",&n,&p); for(int i=1;i<=n;i++){ ll ans=poww(i,p-2); cout<<ans<<endl; } return 0; }
标签:long exgcd main turn target ret 模板 using return
原文地址:https://www.cnblogs.com/zbsy-wwx/p/11761399.html