結果

問題 No.24 数当てゲーム
ユーザー kyuna
提出日時 2018-10-31 00:00:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 323 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-19 10:59:44
合計ジャッジ時間 958 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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