QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#293195 | #6764. Rock Paper Scissors | acidlemon# | WA | 2ms | 3664kb | C++17 | 989b | 2023-12-28 23:10:42 | 2023-12-28 23:10:43 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
#define lson (k << 1)
#define rson (k << 1 | 1)
#if LEMON
#define db(x) cout << "function " << __FUNCTION__ << ", line " << __LINE__ << " : " << #x << " " << x << endl;
#else
#define db(x)
#endif
const int mod = 7 + 1e9;
// const int mod = 998244353;
const int N = 3 + 1e5;
void solve() {
int br, bp, bs;
int dr, dp, ds;
cin >> br >> bp >> bs;
cin >> dr >> dp >> ds;
auto update = [&](int& u, int& v) {
int t = min(u, v);
u -= t;
v -= t;
return t;
};
int ans = 0;
ans += update(dr, bs);
ans += update(dp, br);
ans += update(ds, bp);
update(dr, br);
update(dp, bp);
update(ds, bs);
ans -= dr;
ans -= dp;
ans -= ds;
cout << ans << endl;
}
int main() {
int T;
cin >> T;
while (T--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3612kb
input:
4 4 4 2 10 0 0 0 10 0 2 4 4 1 2 3 3 2 1 10 10 10 10 10 10
output:
-2 2 5 30
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 2ms
memory: 3664kb
input:
1000 0 8 7 1 4 10 6 6 4 6 4 6 3 4 9 7 9 0 4 4 6 6 0 8 2 10 10 10 2 10 0 6 2 2 2 4 4 9 10 7 8 8 5 0 1 0 3 3 2 9 9 4 8 8 6 6 3 7 5 3 7 0 0 2 2 3 7 1 4 3 4 5 2 6 8 5 3 8 5 4 1 2 4 4 0 10 1 2 2 7 0 5 6 1 3 7 2 9 8 9 5 5 5 4 10 4 8 7 2 6 2 3 0 7 7 6 10 10 6 7 10 0 1 3 0 8 10 4 4 8 0 10 8 7 7 8 5 9 8 0 0 ...
output:
5 14 8 6 22 6 16 1 9 8 -1 5 12 9 7 3 14 10 7 21 -7 2 17 4 4 4 6 13 5 9 13 -2 12 15 10 19 7 1 17 0 2 11 9 13 13 12 6 8 7 9 14 -1 17 16 4 0 10 7 10 11 6 20 7 -2 0 7 1 3 8 0 9 0 12 6 15 14 8 0 0 5 17 5 3 15 4 5 4 -1 7 4 1 6 18 5 12 -2 -1 4 14 11 12 5 15 11 17 5 3 5 13 5 9 9 4 -8 4 9 5 13 10 15 7 9 23 9...
result:
ok 1000 lines
Test #3:
score: 0
Accepted
time: 2ms
memory: 3556kb
input:
1000 2 7 6 8 4 3 2 6 10 8 7 3 6 3 5 4 4 6 2 0 5 2 4 1 9 10 7 9 8 9 6 0 7 9 0 4 8 0 0 2 4 2 5 8 2 0 9 6 3 2 5 2 0 8 3 10 10 7 6 10 10 1 1 8 0 4 0 9 1 9 0 1 9 10 4 5 8 10 7 4 10 7 9 5 5 0 4 7 1 1 4 3 6 0 3 10 4 9 3 3 9 4 2 3 4 2 1 6 1 10 4 4 4 7 9 2 0 0 6 5 4 6 7 5 6 6 4 7 7 10 5 3 6 6 1 3 1 9 1 9 7 8...
output:
9 11 9 2 23 3 2 9 1 17 -1 -6 22 16 4 5 11 5 12 5 13 11 5 13 5 6 -1 21 8 4 10 5 18 23 7 16 7 7 13 13 10 14 9 9 6 17 9 20 1 3 12 -2 18 16 1 18 9 10 23 10 -3 6 3 10 7 16 -1 4 3 11 1 7 12 2 -4 25 8 2 6 14 18 17 14 20 7 10 4 12 5 6 10 13 4 -1 7 4 3 4 13 13 -1 2 15 3 4 -3 4 2 8 7 5 16 8 8 20 2 7 3 11 10 0...
result:
ok 1000 lines
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3552kb
input:
1000 484680756 843957427 806304777 984646334 166251796 984044830 764559608 134041377 481723232 550304815 291931710 538087692 270673654 724878140 756640647 825577236 192103785 734511420 322701978 919211519 803750252 397261126 796942172 851460451 937265460 687076149 738245481 838257180 898376696 62595...
output:
1676426597 503650004 1663989292 1164934429 -2093514840 825448809 1851630179 1125985276 640260100 537876743 1360499260 543920632 1219966185 -2089382667 443503395 804550811 503264027 443503947 1432364736 1123010563 418388383 1034195772 886407330 1075975377 277747916 813051558 -4139926 1379250192 -1610...
result:
wrong answer 5th lines differ - expected: '2201452456', found: '-2093514840'