結果

問題 No.24 数当てゲーム
ユーザー 立川和樹立川和樹
提出日時 2022-04-04 18:35:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 607 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,332 KB
実行使用メモリ 66,636 KB
最終ジャッジ日時 2024-05-04 04:04:54
合計ジャッジ時間 1,015 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,536 KB
testcase_01 WA -
testcase_02 RE -
testcase_03 RE -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = []#数値
B = []

C = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
C = set(C)
for i in range(N):
    turn = input().split()
    if turn[-1] == "Yes":
        A.append(turn[:-1])
    else:
        B.append(turn[:-1])

A_s = set(sum(A, []))
B_s = set(sum(B, []))

candidate = A_s - B_s 

A_2 = list(map(set,A))

if len(A) >= 2:
    D = A_2[0] & A_2[1]
    for i in range(len(A) - 2):
        D = D & A_2[i+2]
    X= D & candidate
    X = list(X)
    print(X[0])
elif len(A) == 1:
    candidate = list(candidate)
    print(candidate[0])

else :
    Y = list(C - B_s)
    print(Y[0])
0