結果

問題 No.24 数当てゲーム
ユーザー kyunakyuna
提出日時 2018-10-31 00:00:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 23 ms / 5,000 ms
コード長 323 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 10,560 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-08-12 10:42:41
合計ジャッジ時間 1,068 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
8,588 KB
testcase_01 AC 23 ms
8,580 KB
testcase_02 AC 22 ms
8,696 KB
testcase_03 AC 21 ms
8,552 KB
testcase_04 AC 20 ms
8,560 KB
testcase_05 AC 20 ms
8,652 KB
testcase_06 AC 20 ms
8,552 KB
testcase_07 AC 20 ms
8,576 KB
testcase_08 AC 21 ms
8,592 KB
testcase_09 AC 20 ms
8,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import reduce
yes = []
no  = []
for _ in range(int(input())):
    *x, r = input().split()
    x = set(x)
    if r == 'YES':
        yes.append(x)
    else:
        no.append(x)
if yes:
    ans = reduce(lambda x, y: x & y, yes)
else:
    ans = {str(i) for i in range(10)}
for s in no:
    ans -= s
print(*ans)
0