题解:P15016 [UOI 2020 II Stage] 考试

· · 题解

根据题意判断即可。

#include <iostream>
using namespace std;

int main() {
    int n, a, b, c;
    cin >> n >> a >> b >> c;

    if (a == b){//对了
        cout << n + c;
    } else if (a != 0 && a != b) {
        cout << max(0, n - c / 4);//因为得分不能小于 0
    } else {
        cout << n;
    }

    return 0;
}