这一份代码编译失败
#include<bits/stdc++.h>
using namespace std;
long long x[3000001] = {0, 1}, n, p;
int main() {
ios::sync_with_stdio(false);
cin >> n >> p;
cout << 1 << endl;
for (int c = 2; c <= n; c++) {
x[c] = (p - (p / c)) * x[p % c] % p;
cout << x[c] << '\n';
}
return 0;
}
错误信息:
Nothingiscompiled:OUTPUTexceeds.
记录
这一份是满分代码:
#include<bits/stdc++.h>
using namespace std;
long long x[3000001]={0,1},n,p;
int main()
{
ios::sync_with_stdio(false);
cin>>n>>p;
cout<<1<<endl;
for(int c=2;c<=n;c++)
{
x[c]=p-(p/c)*x[p%c]%p;
cout<<x[c]<<'\n';
}
return 0;
}
记录
有啥不同???