結果

問題 No.24 数当てゲーム
ユーザー k0825k0825
提出日時 2019-03-04 17:03:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 10,868 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2023-09-05 18:06:17
合計ジャッジ時間 1,398 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
10,404 KB
testcase_01 AC 39 ms
10,468 KB
testcase_02 WA -
testcase_03 AC 38 ms
10,416 KB
testcase_04 AC 32 ms
10,184 KB
testcase_05 WA -
testcase_06 AC 32 ms
10,424 KB
testcase_07 AC 32 ms
10,440 KB
testcase_08 AC 34 ms
10,224 KB
testcase_09 AC 32 ms
10,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from statistics import mode
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
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(mode(yes))
else:
	if y_flag > 1: yes = mode(yes)
	for i in range(len(yes)):
		if yes[i] not in no:
			print(yes[i])
			exit()
0