QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#301141#5054. City Brainzzuqy#WA 0ms3716kbC++141.3kb2024-01-09 15:09:572024-01-09 15:09:58

Judging History

你现在查看的是最新测评结果

  • [2024-01-09 15:09:58]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3716kb
  • [2024-01-09 15:09:57]
  • 提交

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;
}

詳細信息

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