3 条题解

  • 0
    @ 2024-10-3 18:06:47

    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;
    }
    

    信息

    ID
    73
    时间
    3000ms
    内存
    512MiB
    难度
    1
    标签
    递交数
    380
    已通过
    226
    上传者