/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 536.0 KiB
#2 Accepted 2ms 532.0 KiB
#3 Accepted 13ms 488.0 KiB
#4 Accepted 28ms 580.0 KiB
#5 Accepted 278ms 1.289 MiB
#6 Accepted 252ms 1.23 MiB
#7 Accepted 257ms 1.223 MiB
#8 Accepted 253ms 1.309 MiB
#9 Accepted 4ms 532.0 KiB
#10 Accepted 255ms 1.223 MiB

Code

#include <iostream>
using namespace std;

void solve() {
    int t;
    cin >> t;
    while (t--) {
        long long a, b, x;
        cin >> a >> b >> x;

        if (a >= x) {
            a = a - x;
        } else {
            x = x - a;
            a = 0;

            if (b >= x) {
                b = b - x;
            } else {
                b = 0;
            }
        }

        cout << a << " " << b << endl;
    }
}

int main() {
    solve();
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1187 Ticket Battle: Hridoy vs Kamona
Contest
Brain Booster #9
Language
C++17 (G++ 13.2.0)
Submit At
2025-04-06 17:47:23
Judged At
2025-04-06 17:47:23
Judged By
Score
100
Total Time
278ms
Peak Memory
1.309 MiB