結果

問題 No.24 数当てゲーム
コンテスト
ユーザー k0825
提出日時 2019-03-04 16:52:09
言語 Python3
(3.14.3 + numpy 2.4.2 + scipy 1.17.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 94 ms / 5,000 ms
コード長 499 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 520 ms
コンパイル使用メモリ 20,956 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2026-03-08 09:12:13
合計ジャッジ時間 1,863 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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(''.join([_ for _ in set(yes) if yes.count(_) > 1]))
else:
	if y_flag > 1: yes = [_ for _ in set(yes) if yes.count(_) > 1]
	for i in range(len(yes)):
		if yes[i] not in no:
			print(yes[i])
			exit()
0