提交时间:2021-05-12 19:45:29
运行 ID: 19246
#include<bits/stdc++.h> using namespace std; int n,r,a[100001],sum; int main(){ cin>>n>>r; for(int i=2;i<=n;i++){ r=(r*6807+2831)%20170; a[i]=r%100+1; } sort(a+1,a+n+1); for(int i=1;i<=n;i++){ sum=sum+(a[i]*(n-i+1)); } cout<<sum-100; }