U514590
作者:
爱Coding的鸠
,
2024-12-13 18:47:25
,
所有人可见
,
阅读 6
C++ 分数代码
#include "bits/stdc++.h"
using namespace std;
int main()
{
int a,n,res=0,combo;
cin >> a >> n;
for (int i = 2; i <= a; i ++ ){
cin >> combo;
combo=i;
res+=max(combo,int((a%i)*max(combo,1)+0.5));
}
long double ans=res*(n*1.0/a);
//ans=1501;
cout << (n*1.0/a) << endl;
if((n*1.0/a)<0.17) {cout << 0;exit(0);}
if((n*1.0/a)<0.25) {cout << 120;exit(0);}
if((n*1.0/a)<0.34) {cout << 150;exit(0);}
if((n*1.0/a)<0.41) {cout << 190;exit(0);}
if((n*1.0/a)<=0.52) {cout << 210;exit(0);}
if(ans<=100) cout << max(int(ans+0.5)+100,210+int(ans*0.6+0.5));
else if (ans<=200||(n*1.0/a)<0.17) cout << int(int(ans-100+0.5)*(0.9+((n*1.0/a)*0.05))+0.6)+200;
else if (ans<=300||(n*1.0/a)<0.3) cout << int(int(ans-200+0.5)*(0.81+((n*0.95/a)*0.06))+0.6)+395;
else if (ans<=400||(n*1.0/a)<0.4) cout << int(int(ans-300+0.5)*(0.61+((n*0.95/a)*0.26))+0.6)+482;
else if (ans<=600||(n*1.0/a)<0.45) cout << int(int(ans-400+0.5)*(0.7+((n*0.92/a)*0.22))+0.6)+576;
else if (ans<=1000||(n*1.0/a)<0.5) cout << int(int(ans-600+0.5)*(0.5+(n*0.85/a)*0.07)+0.4)+650;
else if (ans<=1300) cout << int(int(ans-1000+0.5)*(0.3+(n*0.85/a)*0.4)+0.2)+820;
else if (ans<=1500) cout << int((ans-1300+0.5)*(0.4+(n*0.85/a)*0.3)+0.08)+1000;
else cout << min(int(1020+ans*0.05),2100);
}