제출 #1228188

#제출 시각아이디문제언어결과실행 시간메모리
1228188LaMatematica14Bring Down the Grading Server (CEOI23_gradingserver)C++20
0 / 100
4091 ms1284 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int S, Q; cin >> S >> Q;
    for (int i = 0; i < Q; i++) {
        long long ch, fh, cg, fg; 
        cin >> ch >> fh >> cg >> fg;
        auto usehack = [&](){
            if (ch > fg*S) cg -= ch-fg*S;
            else fg--;
        };
        auto useserv = [&]() {
            if (cg > fh*S) ch -= cg-fh*S;
            else fh--;
        };
        bool b = 0;
        while (ch > 0 && cg > 0) {
            usehack();
            if (cg <= 0) b = 1;
            useserv();
        }
        cout << (b ? "YES" : "NO") << "\n";
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...