結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-08-06 21:01:38 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 32 ms / 5,000 ms | 
| コード長 | 756 bytes | 
| コンパイル時間 | 87 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-10-11 22:58:39 | 
| 合計ジャッジ時間 | 936 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
# -*- coding: utf-8 -*-
if __name__ == '__main__':
    N = int(input())
    turn = []
    for i in range(N):
        turn.append(list(input().split()))
    # YESの数字の積集合を取り,NOの数字の和集合を取る
    yes_intersection = {0,1,2,3,4,5,6,7,8,9}
    no_union = set([])
    for i in range(N):
        turn_set = set(list(map(int, turn[i][:4])))
        if turn[i][4] == 'YES':
            yes_intersection = yes_intersection.intersection(turn_set)
        else:
            no_union = no_union.union(turn_set)
    # NOの和集合の排他集合を取る
    ex_no = {0,1,2,3,4,5,6,7,8,9}.difference(no_union)
    # YESの積集合とex_noの積集合で残る要素が答え
    print(yes_intersection.intersection(ex_no).pop())
            
            
            
        