Phigros Rks Calculator
啊,今天 WC 成绩出来了…… 反正都退役了,也不关我啥事。
不过看到榜后还是百感交集啊。
退役后整的个烂活儿。
#include <windows.h>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
struct Music {
string name;
double level, acc, rks;
}
music[1000];
struct Prog {
string name;
double delta;
}
prog[1000];
int cmp(Music fir, Music sec) {
return fir.rks > sec.rks;
}
int cmp2(Prog fir, Prog sec) {
return fir.delta > sec.delta;
}
double expt[7], lv[7] = {0, 13.2, 13.7, 14.2, 14.7, 15.2, 15.7};
int counter = 0;
double bestphi = 0, res = 0;
void adv() {
cout << "[System] 正在执行 RKS 提升建议系统。接下来的分析仅包含难度在 [13, 16] 内的曲目且不包含未尝试的曲目 (rks 为 0)。" << endl;
Sleep(2000);
double lowrks = music[19].rks;
int m = 0;
for(int i = 1; i <= counter; ++i) {
if(music[i].rks == 0) break;
int type = 0;
if(music[i].level < 13) continue;
if(13.0 <= music[i].level && music[i].level <= 13.4) type = 1;
else if(13.5 <= music[i].level && music[i].level <= 13.9) type = 2;
else if(14.0 <= music[i].level && music[i].level <= 14.4) type = 3;
else if(14.5 <= music[i].level && music[i].level <= 14.9) type = 4;
else if(15.0 <= music[i].level && music[i].level <= 15.4) type = 5;
else type = 6;
double exprks = (100 * expt[type] - 55) / 45 * (100 * expt[type] - 55) / 45 * music[i].level;
double nowrks = music[i].rks;
if(expt[type] < 0.7) exprks = 0;
++m;
prog[m].delta = exprks - max(nowrks, lowrks); prog[m].name = music[i].name; prog[m].delta /= 20;
}
sort(prog + 1, prog + m + 1, cmp2);
cout << "[System] 前 5 首建议提升的曲子为(有可能不满 5 首):" << endl;
for(int i = 1; i <= 5; ++i) {
if(prog[i].delta < 0) break;
cout << "曲目: " << prog[i].name;
for(int j = prog[i].name.length(); j <= 28; ++j) cout << " ";
cout << "对总 rks 的提升期望:" << prog[i].delta << endl;
}
cout << "[System] 建议系统执行完毕。" << endl;
}
int main() {
printf("[System] Welcome to Phigros RankingScore Calculator.\n");
cout << "请输入你对自己以下难度的期望 Acc(%) 值,这有助于我们对你的 RKS 提升做出建议。" << endl;
cout << "对于 13.0 - 13.4 级曲,你的期望 Acc 为:"; cin >> expt[1]; expt[1] /= 100;
cout << "对于 13.5 - 13.9 级曲,你的期望 Acc 为:"; cin >> expt[2]; expt[2] /= 100;
cout << "对于 14.0 - 14.4 级曲,你的期望 Acc 为:"; cin >> expt[3]; expt[3] /= 100;
cout << "对于 14.5 - 14.9 级曲,你的期望 Acc 为:"; cin >> expt[4]; expt[4] /= 100;
cout << "对于 15.0 - 15.4 级曲,你的期望 Acc 为:"; cin >> expt[5]; expt[5] /= 100;
cout << "对于 15.5 - 16.0 级曲,你的期望 Acc 为:"; cin >> expt[6]; expt[6] /= 100;
Sleep(500);
printf("[System] Please insure that data.txt is in this file. Press any key if it's ready.\n");
system("pause");
freopen("data.txt", "r", stdin);
printf("[System] We're dealing with the data... Please wait...\n");
while(true) {
++counter;
cin >> music[counter].name;
if(music[counter].name == "end") break;
cin >> music[counter].level >> music[counter].acc; music[counter].acc /= 100;
if(music[counter].acc < 0.7) music[counter].rks = 0;
else if(music[counter].acc == 1) music[counter].rks = music[counter].level, bestphi = max(bestphi, music[counter].level);
else music[counter].rks = (100 * music[counter].acc - 55) / 45 * (100 * music[counter].acc - 55) / 45 * music[counter].level;
cout << "[System] " << music[counter].name << " delt.";
for(int i = music[counter].name.length(); i <= 28; ++i) cout << " ";
cout << "RKS: " << music[counter].rks << endl;
Sleep(20);
}
--counter;
fclose(stdin);
printf("[System] %d songs recorded. Press any key to start calculating!\n", counter);
system("pause");
sort(music + 1, music + counter + 1, cmp);
Sleep(1000);
printf("[System] Calculation finished. Your top 19 performances(b19) are:\n");
for(int i = 1; i <= 19; ++i) {
Music cur = music[i];
cout << "Name: " << cur.name;
for(int i = cur.name.length(); i <= 28; ++i) cout << " ";
cout << "level: " << cur.level << " " << "RKS: " << cur.rks << endl;
res += cur.rks;
}
printf("\n");
if(bestphi) {
res += bestphi;
string phiname;
for(int i = 1; i <= counter; ++i) {
Music cur = music[i];
if(cur.acc == 1.0 && cur.level == bestphi) {
phiname = cur.name;
break;
}
}
cout << "[System] Among all tracks which you've got an 'All Perfect', ";
cout << phiname;
cout << " has the highest level, which is " << bestphi << "." << endl;
}
else printf("[System] You haven't any PHI performance yet.");
printf("\n[System] Your final Ranking Score is %.2lf\n", res / 20);
adv();
return 0;
}
data.txt (截至 2021/2/6)
Glaciaxion 11.2 0
EradicationCatastrophe 12.1 0
Credits 13.7 94.09
Dlyrotz 14.6 98.59
EnginexStart 13.4 99.52
Guang 13.6 100.00
WinterCube 13.4 97.91
Confusion 13.9 95.49
Cipher 14.9 0
FULiAUTOSHOOTER 15.3 98.30
HumaN 13.2 0
PRAW 14.6 0
Cereris 14.8 96.69
PixelRebelz 14.3 0
NonMelodicRagez 15.8 86.35
SultanRage 12.2 99.21
ClassMemories 12.8 96.08
SURREALISM 13.4 0
BonusTime 14.2 92.20
ENERGYSYNERGYMATRIX 14.8 0
NYA 12.9 0
JunXionBetweenLifeAndDeath 13.3 98.41
cryout 13.7 0
Reimei 15.3 95.07
TheGuru 15.2 96.42
Spasmodic 15.4 95.33
LeaveAllBehind 12.7 99.34
ColorfulDays 12.7 0
microwav 14.5 96.81
ChongSheng 14.6 97.78
NOONEYESMAN 15.1 0
WangYingFangZhouSix 15.9 85.83
Igallta 15.8 0
Ποσειδών 12.8 98.71
WATER 13.6 99.29
MiracleForest 13.9 95.34
MOBILYS 14.4 97.78
Lyrith 15.7 85.84
Aphasia 13.1 98.43
KaiXinBing 13.7 96.14
HuaDengAi 13.8 0
AnotherMe 13.2 95.67
mechanted 14.7 0
lifeflashesbeforeweebeyes 14.8 0
BreakThroughTheBarrier 14.9 88.14
Chronostasis 15.9 0
InfinityHeaven 13.6 98.20
Disorder 14.7 89.78
CROSSSOUL 15.9 91.33
GOODTEK 14.2 92.00
GOODBOUNCE 14.4 0
GOODWORLD 14.5 0
GOODFORTUNE 15.4 85.84
GOODRAGE 15.8 79.09
DBDoll 7.2 100.00
mopemope 11.1 97.96
NextTime 12.6 0
Dash 11.5 0
RubbishSorting 12.8 0
YunNvHai 12.8 94.40
SparkleNewLife 12.9 98.09
YingHuoChongDeYuan 13.4 99.92
DeadSoul 13.4 87.50
SnowDesert 13.6 95.45
Electron 13.6 100.00
WanDunNiMingXin 13.6 99.06
Aventyr 13.7 0
FengYu 13.7 97.92
GetBack 13.8 0
Orthodox 14.2 0
EndMe 14.3 95.80
KuangXiLanWu 14.4 98.29
ParallelRetrogression 14.4 0
TheMountainEater 14.4 95.66
FindMe 14.4 0
DropIt 14.4 0
MARENOL 14.5 0
MagentaPotion 14.5 0
HardcoreKwaya 14.6 0
CervelleConnexion 14.5 94.66
Trane 14.5 95.42
SpeedUp 14.6 98.68
modulus 15.4 92.82
KhronostasisKatharsis 14.6 0
Starduster 14.8 0
Burn 14.8 91.18
Doppelganger 14.8 0
Sein 14.9 0
XueJiang 15.3 0
Aleph0 15.5 81.19
SIGMA 15.6 90.22
Palescreen 15.5 0
RIPPER 15.7 0
end