update
This commit is contained in:
parent
27d3dd0aa3
commit
56b1fdd6c4
23
src/P3811/P3811.cpp
Normal file
23
src/P3811/P3811.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
int main(){
|
||||
using ll = int64_t;
|
||||
ll n,p;
|
||||
std::cin>>n>>p;
|
||||
auto pow = [](ll b, ll e, ll m)->ll{
|
||||
b%=m;
|
||||
ll res{1};
|
||||
while(e!=0){
|
||||
if(e&1){
|
||||
res=(res*b)%m;
|
||||
}
|
||||
e>>=1;
|
||||
b=(b*b)%m;
|
||||
}
|
||||
return res;
|
||||
};
|
||||
for(ll i{1};i<=n;i++){
|
||||
std::cout<<pow(i, p-2, p)<<'\n';
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user