4 条题解
-
3
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
Arcaea Scoring System
思路
本题不需要任何思路
解题方法
按题意计算分数后使用多分支的if语句完成,注意精度问题
复杂度
时间复杂度:
空间复杂度:
Code
#include <bits/stdc++.h> using namespace std; const int N = 1e7, M = 1e6; int main () { int p1, p0, f, l; long double ans = 0; cin >> p1 >> p0 >> f >> l; int n = p1 + p0 + f + l; ans = ((N / n * p1 + p1 * n) + (N / n * p0) + (f * N / n / 2)); //cout << ans; if (ans >= 9.9 * M) { cout << "EX+"; } else if (ans >= 9.8 * M) { cout << "EX"; } else if (ans >= 9.5 * M) { cout << "AA"; } else if (ans >= 9.2 * M) { cout << "A"; } else if (ans >= 8.9 * M) { cout << "B"; } else if (ans >= 8.6 * M) { cout << "C"; } else { cout << "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
- 标签
- 递交数
- 404
- 已通过
- 236
- 上传者