个人简介是不是也要头图啊……
0x00 …
2026马年快乐!!!
十年OI一场空,不开long long见祖宗!
骗分过样例,暴力出奇迹。
数学先打表,DP 看运气。
穷举 TLE,模拟 MLE,贪心还 CE。
老骥伏枥,志在千里。
广州地铁,全程为你。
垂死病中惊坐起,抢铁U彩提示你。
0x01 语文区
将进酒
君不见黄河之水天上来,奔流到海不复回。
君不见高堂明镜悲白发,朝如青丝暮成雪。
人生得意须尽欢,莫使金樽空对月。
天生我材必有用,千金散尽还复来。
烹羊宰牛且为乐,会须一饮三百杯。
岑夫子,丹丘生,将进酒,杯莫停。
与君歌一曲,请君为我倾耳听。
钟鼓馔玉不足贵,但愿长醉不复醒。
古来圣贤皆寂寞,惟有饮者留其名。
陈王昔时宴平乐,斗酒十千恣欢谑。
主人何为言少钱,径须沽取对君酌。
五花马、千金裘,呼儿将出换美酒,与尔同销万古愁。
西江月・证明
即得易见平凡,仿照上例显然。
留作习题答案略,读者自证不难。
反之亦然同理,推论自然成立。
略去过程Q.E.D.,由上可知证毕。
0x02 公式区
emmm…无聊放点公式
一元二次方程求根公式:
一元三次方程求根公式:
0x03 “正确”(?)的记录全拼
AC=Answer Course=粗略的答案
WA=Wonderful Answer=完美的答案
RE=Run Excellently=完美运行
TLE=Time Limit Enough=时间充裕
MLE=Memory Limit Enough=空间充裕
OLE=Ouput Limit Enough=输出空间充裕
SE=System Excellent=系统良好
CE=Compile Excellently=编译完美
UKE=Unknown Excellent=未知的优秀
AK=Answer Klutzy=粗略的回答
#include <iostream>
#include<iomanip>
#include<vector>
using namespace std;
const double DECAY = 0.81; // AtCoder 权重衰减系数
const double ELO_DIV = 400.0; // Elo 公式中的分母
// 全局防优化变量
volatile long long g_sink;
// ------------------------------------------------------------
// 根据排名和全场 Rating 分布,二分求解 Performance
// ------------------------------------------------------------
double calcPerformance(int rank, const vector<double>& ratings) {
double lo = -8000.0, hi = 8000.0;
double target = rank - 0.5;
for (int it = 0; it < 100; ++it) {
double mid = (lo + hi) * 0.5;
double sum = 0.0;
for (double r : ratings) {
sum += 1.0 / (1.0 + pow(10.0, (mid - r) / ELO_DIV));
}
if (sum > target)
lo = mid;
else
hi = mid;
}
return (lo + hi) * 0.5;
}
// ------------------------------------------------------------
// 根据历史 Performance 计算新 Rating
// perfs[0] = 第一场(最旧),perfs.back() = 最新一场
// ------------------------------------------------------------
double calcRating(const vector<double>& perfs) {
int n = perfs.size();
double num = 0.0, den = 0.0;
for (int i = 0; i < n; ++i) {
double w = pow(DECAY, n - 1 - i);
num += perfs[i] * w;
den += w;
}
return num / den;
}
// ------------------------------------------------------------
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
// Windows 控制台支持 UTF-8 中文输出
#ifdef _WIN32
// system("chcp 65001 > nul");
#endif
cout << "=== AtCoder 等级分预估器 ===\n"
<< "基于官方公式:Performance 通过 Elo 计算,Rating = 加权平均 (q=0.81)\n\n";
double curR;
int pastN;
cout << "当前等级分: ";
cin >> curR;
cout << "已参加过的 rated 比赛场数: ";
cin >> pastN;
// ---------- 历史 Performance 输入 ----------
int histMode;
cout << "\n[历史成绩]\n"
<< " 1: 我不知道历史 Performance(假设全部等于当前等级分)\n"
<< " 2: 我要手动输入历史 Performance(从最旧到最新)\n"
<< "选择: ";
cin >> histMode;
vector<double> history;
if (histMode == 2) {
history.resize(pastN);
cout << "输入 " << pastN << " 场历史 Performance:\n";
for (int i = 0; i < pastN; ++i) cin >> history[i];
} else {
history.assign(pastN, curR);
}
// ---------- 计算模式 ----------
int mode;
cout << "\n[计算模式]\n"
<< " 1: 直接输入预估的 Performance\n"
<< " 2: 根据排名 + 对手等级分估算\n"
<< " 3: 批量查询(显示排名 1~N 的表格)\n"
<< "选择: ";
cin >> mode;
if (mode == 1) {
double perf;
cout << "预估 Performance: ";
cin >> perf;
auto h = history;
h.push_back(perf);
double newR = calcRating(h);
cout << fixed << setprecision(2);
cout << "\nPerformance: " << perf
<< "\n新等级分 : " << newR
<< "\n变化值 : " << (newR >= curR ? "+" : "") << (newR - curR) << "\n";
}
else if (mode == 2) {
int n, rank;
cout << "总参赛人数: ";
cin >> n;
cout << "你的排名(从1开始): ";
cin >> rank;
int oppMode;
cout << "\n[对手信息]\n"
<< " 1: 输入全部 " << n << " 个等级分(包含你自己,用当前等级分 " << curR << ")\n"
<< " 2: 近似:其他所有人都等于平均等级分\n"
<< "选择: ";
cin >> oppMode;
vector<double> ratings;
if (oppMode == 1) {
ratings.resize(n);
cout << "输入等级分:\n";
for (int i = 0; i < n; ++i) cin >> ratings[i];
} else {
double avgR;
cout << "对手平均等级分: ";
cin >> avgR;
ratings.assign(n, avgR);
ratings[0] = curR;
}
double perf = calcPerformance(rank, ratings);
auto h = history;
h.push_back(perf);
double newR = calcRating(h);
cout << fixed << setprecision(2);
cout << "\n预估 Performance: " << perf
<< "\n新等级分 : " << newR
<< "\n变化值 : " << (newR >= curR ? "+" : "") << (newR - curR) << "\n";
}
else if (mode == 3) {
int n;
double avgR;
cout << "总参赛人数: ";
cin >> n;
cout << "对手平均等级分: ";
cin >> avgR;
vector<double> ratings(n, avgR);
ratings[0] = curR;
cout << "\n" << string(50, '-') << "\n";
cout << " 排名 | Performance | 新等级分 | 变化值\n";
cout << string(50, '-') << "\n";
int showUpTo = min(n, 60);
for (int rank = 1; rank <= showUpTo; ++rank) {
double perf = calcPerformance(rank, ratings);
auto h = history;
h.push_back(perf);
double newR = calcRating(h);
double delta = newR - curR;
cout << right << setw(5) << rank << " | ";
cout << setw(11) << fixed << setprecision(2) << perf << " | ";
cout << setw(12) << newR << " | ";
cout << (delta >= 0 ? "+" : "") << delta << "\n";
}
if (n > showUpTo)
cout << " ... (仅显示前 " << showUpTo << " 名)\n";
}
if (curR < 400) {
cout << "\n[提示] 你当前等级分 < 400。AtCoder 对低于 400 的显示等级分应用了非线性变换,\n"
<< "因此预测值可能与实际显示的等级分略有差异。\n";
}
return 0;
}


