結果

問題 No.24 数当てゲーム
ユーザー NakLon131NakLon131
提出日時 2022-07-17 17:55:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 693 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 8,296 KB
最終ジャッジ日時 2023-09-12 06:10:28
合計ジャッジ時間 1,175 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,180 KB
testcase_01 AC 16 ms
8,228 KB
testcase_02 AC 18 ms
8,248 KB
testcase_03 AC 16 ms
8,228 KB
testcase_04 AC 17 ms
8,240 KB
testcase_05 AC 16 ms
8,296 KB
testcase_06 AC 16 ms
8,112 KB
testcase_07 AC 16 ms
8,292 KB
testcase_08 AC 17 ms
8,112 KB
testcase_09 AC 16 ms
8,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# input
N = int(input())
A_D = []
R = []

in_l = []
for i in range(N):
	a,b,c,d,r = input().split()
	A_D.append([int(a), int(b), int(c), int(d)])
	R.append(r)

ans_l = [True for i in range(10)]

# YES → 答えの候補から、入力4つ以外のものを消す
# NO → 入力4つを消す
for i in range(N):
	if(R[i] == 'YES'):
		for j in range(10):
			if(not ans_l[j]):
				continue
			if(not(A_D[i][0] == j) and not(A_D[i][1] == j) and not(A_D[i][2] == j) and not(A_D[i][3] == j)):
				ans_l[j] = False

	else:
		for j in range(10):
			if(A_D[i][0] == j or A_D[i][1] == j or A_D[i][2] == j or A_D[i][3] == j):
				ans_l[j] = False

for j in range(10):
	if(ans_l[j]):
		print(j)
		exit()
0