提交时间:2021-05-13 21:40:27
运行 ID: 19290
#include<bits/stdc++.h> using namespace std; int n,r[1001],ans; int main(){ cin>>n>>r[1]; for(int i=2;i<=n;i++){ r[i]=(r[i-1]*6807+2831)%201701; r[i-1]=(r[i-1]%100)+1; } r[n]=(r[n]%100)+1; sort(r+1,r+n+1); for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ ans+=r[j]; } } cout<<ans; return 0; }