結果

問題 No.24 数当てゲーム
コンテスト
ユーザー a_ten
提出日時 2016-03-14 17:17:50
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 96 ms / 5,000 ms
コード長 446 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 135 ms
コンパイル使用メモリ 76,808 KB
最終ジャッジ日時 2025-12-03 19:48:56
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#coding:utf-8

N=input()
list=[raw_input().split() for i in range(N)]

no=[]
yes=[]
for i in list:
	if i[4] == 'NO':
		for u in i[:4]:
			no.append(u)
	else:
		for u in i[:4]:
			yes.append(u)

if no and not yes:
	for i in range(10):
		if str(i) not in no:
			print i
			break
elif not no and yes:
	for i in yes:
		if 2 <= yes.count(i):
			print i
			break
else:
	for i in yes:
		if i not in no and len(yes)/4 <= yes.count(i):
			print i
			break
0