3 条题解
-
1
Arcaea Scoring System
思路
依题意模拟即可,注意精度问题
The Code
#include <cstdio> int main(){ int p1, p0, f, l; scanf("%d%d%d%d", &p1, &p0, &f, &l); int n = p1 + p0 + f + l; int ans = (1e7 / n + 1) * p1 + 1e7 / n*p0 + 1e7 / 2 / n*f; //此处将9.9*1e6写作99*1e5,防止可能的精度问题,下同 if (ans >= 99 * 1e5) printf("EX+"); else if (ans >= 98 * 1e5) printf("EX"); else if (ans >= 95 * 1e5) printf("AA"); else if (ans >= 92 * 1e5) printf("A"); else if (ans >= 89 * 1e5) printf("B"); else if (ans >= 86 * 1e5) printf("C"); else printf("D"); return 0; }
-
0
73题解
(蒟蒻的第一篇题解)大水题,不需要过多讲解. 各位大佬可以从代码中学习/吸取经验.
#include <algorithm> #include <iostream> #include <stdio.h> #include <string.h> using namespace std; int main() { int p1, p0, f, l, total, basic = 1e7; double score = 0, single; cin >> p1 >> p0 >> f >> l; total = p1 + p0 + f + l; single = (double)basic / total; score += p1 * (single + 1) + p0 * single + f * (single / 2.); if (score >= 9.9e+6) { cout << "EX+"; } else if (score >= 9.8e+6) { cout << "EX"; } else if (score >= 9.5e+6) { cout << "AA"; } else if (score >= 9.2e+6) { cout << "A"; } else if (score >= 8.9e+6) { cout << "B"; } else if (score >= 8.6e+6) { cout << "C"; } else { cout << "D"; } return 0; }
- 1
信息
- ID
- 73
- 时间
- 3000ms
- 内存
- 512MiB
- 难度
- 1
- 标签
- 递交数
- 380
- 已通过
- 226
- 上传者