結果

問題 No.24 数当てゲーム
ユーザー jjwattjjwatt
提出日時 2020-03-18 09:26:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 13 ms / 5,000 ms
コード長 721 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 11,012 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2023-08-20 19:42:41
合計ジャッジ時間 842 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,764 KB
testcase_01 AC 13 ms
7,812 KB
testcase_02 AC 13 ms
7,696 KB
testcase_03 AC 13 ms
7,836 KB
testcase_04 AC 12 ms
7,832 KB
testcase_05 AC 12 ms
7,832 KB
testcase_06 AC 13 ms
7,720 KB
testcase_07 AC 13 ms
7,720 KB
testcase_08 AC 13 ms
7,852 KB
testcase_09 AC 13 ms
7,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0