結果

問題 No.24 数当てゲーム
ユーザー k0825k0825
提出日時 2019-03-05 13:58:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 520 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 8,628 KB
最終ジャッジ日時 2023-09-05 18:55:34
合計ジャッジ時間 905 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,556 KB
testcase_01 AC 21 ms
8,616 KB
testcase_02 AC 20 ms
8,520 KB
testcase_03 WA -
testcase_04 AC 19 ms
8,556 KB
testcase_05 AC 19 ms
8,628 KB
testcase_06 AC 19 ms
8,492 KB
testcase_07 AC 19 ms
8,496 KB
testcase_08 AC 19 ms
8,492 KB
testcase_09 AC 19 ms
8,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n = int(input())
yes = []
no = []
y_flag = 0
n_flag = 0
for i in range(n):
	a = input().split()
	if a[-1] == 'YES':
		yes.extend(a[:-1])
		y_flag += 1
	else:
		no.extend(a[:-1])
		n_flag += 1
c = Counter(yes)
if y_flag == 0:
	print(''.join([str(i) for i in range(0, 10) if str(i) not in no]))
elif n_flag == 0:
	print(c.most_common(1)[0][0])
else:
	if y_flag > 1: yes = [i for i in set(yes) if yes.count(i) > 1]
	for i in range(len(yes)):
		if yes[i] not in no:
			print(yes[i])
			exit()
0