WA 40pts (悬关
查看原帖
WA 40pts (悬关
1108078
nothing_exe_studio楼主2024/6/8 12:26
#include <iostream>
using namespace std;
void esc(int M, int S, int T) {
    int mag = M;
    int pos = 0;
    for (int time = 1; time <= T; ++time) {
        if (mag >= 10) {
            pos += 60;
            mag -= 10;
        } else {
            if (mag + 4 >= 10)
                mag += 4;
            else
                pos += 17;
        }
        if (pos >= S) {
            cout << "Yes" << endl;
            cout << time << endl;
            return;
        }
    }
    cout << "No" << endl;
    cout << pos << endl;
}
int main() {
    int M, S, T;
    cin >> M >> S >> T;
    esc(M, S, T);
}
2024/6/8 12:26
加载中...