QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#718828 | #6764. Rock Paper Scissors | 333zhan | AC ✓ | 1ms | 3716kb | C++20 | 968b | 2024-11-06 21:34:33 | 2024-11-06 21:34:33 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
void solve () {
array <int, 3> b {};
for (int i = 0; i < 3; i ++) {
cin >> b[i];
}
array <int, 3> d {};
for (int i = 0; i < 3; i ++) {
cin >> d[i];
}
int ans = 0;
for (int i = 0; i < 3; i ++) {
if (b[i] && d[(i + 1) % 3]) {
int t = min (b[i], d[(i + 1) % 3]);
ans += t;
b[i] -= t;
d[(i + 1) % 3] -= t;
}
}
for (int i = 0; i < 3; i ++) {
if (b[i] && d[i]) {
int t = min (b[i], d[i]);
b[i] -= t;
d[i] -= t;
}
}
for (int i = 0; i < 3; i ++) {
ans -= b[i];
}
cout << ans << '\n';
}
signed main () {
ios::sync_with_stdio (false);
cin.tie (nullptr);
int T = 1;
cin >> T;
while (T --) {
solve ();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3644kb
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: 0ms
memory: 3644kb
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: 1ms
memory: 3584kb
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: 0
Accepted
time: 1ms
memory: 3716kb
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 2201452456 825448809 1851630179 1125985276 640260100 537876743 1360499260 543920632 1219966185 2205584629 443503395 804550811 503264027 443503947 1432364736 1123010563 418388383 1034195772 886407330 1075975377 277747916 813051558 -4139926 1379250192 2684669...
result:
ok 1000 lines
Test #5:
score: 0
Accepted
time: 1ms
memory: 3660kb
input:
1000 268198761 117076550 145974185 71678774 51923673 407647049 716338051 686526856 290694277 517691722 306716671 869150791 572265617 808826992 320077650 975715686 114148053 611306520 366005043 986650316 848973032 715089985 566574521 919963885 83884675 919656864 13156430 165565540 533384347 317748082...
output:
24403909 1101313869 848011751 1867175866 262380077 1239521705 703338625 241337500 617150792 1294391543 1878539977 120281875 329328791 1137097364 66034609 -189676443 2180666529 444647969 57156592 321068281 1905662517 1471940848 1929238531 1494446031 1100189417 305322787 1078071213 1437030857 -4360331...
result:
ok 1000 lines