結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  jjwatt | 
| 提出日時 | 2020-03-18 09:26:08 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 31 ms / 5,000 ms | 
| コード長 | 721 bytes | 
| コンパイル時間 | 330 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-12-14 01:27:51 | 
| 合計ジャッジ時間 | 1,224 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
n=int(input())
a=[i for i in range(10)]
b=[]
count=0
for i in range(n):
    x=list(input().split())
    if x[4]=="NO":
        for i in range(4):
            if int(x[i]) in a:
                a.remove(int(x[i]))
            else:
                continue
    elif x[4]=="YES" and count==0:
        b.append(int(x[0]))
        b.append(int(x[1]))
        b.append(int(x[2]))
        b.append(int(x[3]))
        count+=1
    elif x[4]=="YES" and count>=1:
        b.append(int(x[0]))
        b.append(int(x[1]))
        b.append(int(x[2]))
        b.append(int(x[3]))
        b=[x for x in set(b) if b.count(x) > 1]
if a==[]:
    print(*b)
elif b==[]:
    print(*a)
else:
    for i in list(set(a)&set(b)):
        print(i)
            
            
            
        