結果

問題 No.24 数当てゲーム
ユーザー arito_asu
提出日時 2020-06-13 17:51:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-25 16:03:15
合計ジャッジ時間 1,194 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
inp = []
for i in range(N):
    inp.append(input().split())
    
cards = list('0123456789')
pos = []

for t in inp:
    isIn = t.pop(-1)
    if isIn == "NO":
        for n in t:
            if n in cards:
                cards.remove(n)
            else:
                break
    else:
        common = list(set(t) & set(pos))
        if common:
            pos = common
        else:
            pos.extend(t)
        pos = list(set(pos))
        
if len(set(cards) & set(pos)) == 1:
    ans = list(set(cards) & set(pos))[0]
else:
    ans = cards[0]
  
print(ans)
0