提交时间:2021-05-15 17:14:51

运行 ID: 19393

#include<bits/stdc++.h> using namespace std; int a[1010],r[1010]; int main() { int n,i,ans=0,tot=0; cin>>n>>r[1]; for(i=1;i<=n;++i){ a[i]=(r[i]%100)+1; r[i+1]=(r[i]*6807+2831)%201701; } sort(a+1,a+n+1); for(i=1;i<=n;++i){ tot+=a[i]; ans+=tot; } cout<<ans; return 0; }