标签:style iostream col algorithm int pre i++ name stream
#include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<algorithm> #define ll long long using namespace std; ll n,p,a[3000001]; int main() { scanf("%lld%lld",&n,&p); a[1]=1; printf("%lld\n",a[1]); for(int i=2;i<=n;i++) { a[i]=-(p/i)*a[p%i]; a[i]=(a[i]%p+p)%p; printf("%lld\n",a[i]); } return 0; }
标签:style iostream col algorithm int pre i++ name stream
原文地址:https://www.cnblogs.com/water-radish/p/9280543.html