/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 388.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 2ms 348.0 KiB
#4 Accepted 5ms 596.0 KiB
#5 Accepted 35ms 1.379 MiB
#6 Accepted 43ms 1.316 MiB
#7 Accepted 58ms 1.27 MiB
#8 Accepted 41ms 1.262 MiB
#9 Accepted 2ms 532.0 KiB
#10 Accepted 36ms 1.203 MiB

Code

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
//#include <queue>
//#include <numeric>
#include <cassert>

using namespace std;

#ifdef LOCAL_DEBUG
#include <local_debug.h>
#define DEBUG(...) DBG2::cprint(#__VA_ARGS__, __LINE__, __VA_ARGS__)
#else
#define DEBUG(...)
#endif

#define SZ(a) int((a).size())
#define REP(i,n) for(int i=0,_n=(n);i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)

using llong = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using II = pair<int,int>;

void solve(int A, int B, int X) {
   if (X <= A) {
      cout << A-X << ' ' << B << '\n';
      return;
   }
   if (X <= A+B) {
      cout << 0 << ' ' << B-(X-A) << '\n';
      return;
   }
   cout << 0 << ' ' << 0 << '\n';
}

int main(int argc, char* argv[]) {
   ios_base::sync_with_stdio(false); 
   cin.tie(nullptr);

   int TC;
   cin >> TC;
   FOR(tc, 1, TC) {
      int A, B, X;
      cin >> A >> B >> X;
      solve(A, B, X);
   }

   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 15:33:37
Judged At
2025-04-06 15:33:37
Judged By
Score
100
Total Time
58ms
Peak Memory
1.379 MiB