結果

問題 No.24 数当てゲーム
ユーザー 👑 もぐら 3.0もぐら 3.0
提出日時 2023-11-13 19:56:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 35 ms / 5,000 ms
コード長 603 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 53,460 KB
最終ジャッジ日時 2023-11-13 19:56:52
合計ジャッジ時間 1,243 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

box = set()
for i in range(10):
    box.add(i)
YES = [0]*10
cnt=0
N = int(input())
for i in range(N):
    A,B,C,D,R = map(str,input().split())
    if R=="NO":
        if int(A) in box:
            box.remove(int(A))
        if int(B) in box:
            box.remove(int(B))
        if int(C) in box:
            box.remove(int(C))
        if int(D) in box:
            box.remove(int(D))
    else:
        cnt+=1
        YES[int(A)]+=1
        YES[int(B)]+=1
        YES[int(C)]+=1
        YES[int(D)]+=1

for y in range(10):
    if YES[y]<cnt:
        if y in box:
            box.remove(y)

print(*box)
0