QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#301141 | #5054. City Brain | zzuqy# | WA | 0ms | 3716kb | C++14 | 1.3kb | 2024-01-09 15:09:57 | 2024-01-09 15:09:58 |
Judging History
answer
#include <bits/stdc++.h>
char a1[20], a2[20], b[20], c[30], d[20];
inline int get(char c) {
if (c >= '0' && c <= '9')
return c - '0';
if (c == 'T')
return 10;
if (c == 'J')
return 11;
if (c == 'Q')
return 12;
if (c == 'K')
return 13;
if (c == 'A')
return 14;
}
int o[6];
int main() {
int T;
scanf("%d", &T);
while (T--) {
scanf("%s%s%s%s%s", a1, a2, b, c, d);
char x = a1[1];
if (x != a2[1] || x != b[1] || x != c[1] || x != d[1]) {
puts("check");
} else {
o[0] = get(a1[0]);
o[1] = get(a2[0]);
o[2] = get(b[0]);
o[3] = get(c[0]);
o[4] = get(d[0]);
std::sort(o, o + 5);
if (o[0] == 2 && o[1] == 3 && o[2] == 4 && o[3] == 5 && o[4] == 14) {
if ((get(a1[0]) != o[3] && get(a2[0]) != o[3]) ||
(get(a1[0]) != o[4] && get(a2[0]) != o[4])) {
puts("check");
} else
puts("allin");
} else if (o[1] != o[0] + 1 || o[2] != o[0] + 2 || o[3] != o[0] + 3 || o[4] != o[0] + 4) {
puts("check");
} else {
int max = std::max(get(a1[0]), get(a2[0]));
int ooo = o[4] - max;
ooo = 5 - ooo;
if (ooo > 4) {
puts("allin");
} else if (o[4] + ooo > 14) {
puts("allin");
} else
puts("check");
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3716kb
input:
6 5 1 1 2 3 2 2 4 4 5 4 6 1 5 3 6
output:
check check check check check check
result:
wrong output format Expected double, but "check" found