提交时间:2021-05-19 20:19:16
运行 ID: 19692
#include<bits/stdc++.h> using namespace std; int n,r[1001],a[1001],ans,t; int main(){ cin>>n>>r[1]; for(int 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(int i=1;i<=n;i++){ t+=a[i]; ans+=t; } cout<<ans; return 0; }