标签:ima 乘法 span 技术 bsp ring 技术分享 code return
#include <cstdio> #include <cmath> #include <cstring> #include <iostream> #include <algorithm> using namespace std; long long n, p, ans[3000010]; int main() { scanf("%lld%lld", &n, &p); ans[1] = 1; for (int i = 2; i <= n; i++) ans[i] = 1LL * (p - p / i) * ans[p % i] % p; for (int i = 1; i <= n; i++) printf("%lld\n", ans[i]); return 0; }
标签:ima 乘法 span 技术 bsp ring 技术分享 code return
原文地址:http://www.cnblogs.com/zbtrs/p/7815416.html