test
2024-10-06 15:07:43
发布于:广东
#include <iostream>
#include <cstdio>
#include <cmath>
#include <memory.h>
#define int double
using namespace std;
int scores[1005];
signed idx, n;
int ct;
int P[1005][1005];
int seed[1005], m[1005];
void check(){
memset(seed, 0, sizeof(seed));
for(signed i = 1; i <= n; i++){
for(signed j = 1; j <= n; j++){
P[i][j] = 1 / (1 + pow(10, (scores[j] - scores[i]) / 400));
}
}
for(signed i = 1; i <= n; i++){
for(signed j = 1; j <= n; j++){
if(i == j) continue;
seed[i] += P[j][i];
}
seed[i]++;
}
}
signed main(){
cout << "请输入人数:\n";
cin >> n;
signed i;
for(i = 1; i <= n; i++){
cout << "请输入第" << i << "名的排位分:(不想输入就输出-1)\n";
cin >> scores[i];
if(scores[i] == -1) break;
ct += scores[i];
}
for(signed j = i + 1; j <= n; j++){
scores[j] = ct / i / 2;
}
cout << "请输入你在第几名:\n";
cin >> idx;
check();
int ans = sqrt(seed[idx] * idx);
int l = 0, r = 1e6;
while(l < r - (1e-6)){
scores[idx] = (l + r) / 2;
check();
if(seed[idx] > ans) l = scores[idx];
else r = scores[idx];
}
cout << "你的表现分为:" << l;
return 0;
}
全部评论 1
老实了吧(有Bug):
2024-10-10 来自 浙江
0?不是我就一测试
2024-10-10 来自 广东
0这玩意没有快速获取所有人的排位分的办法就废了
2024-10-10 来自 广东
0而且这东西不是这么用的 这是提前测排位赛过后能得多少分的
2024-10-10 来自 广东
0
有帮助,赞一个