結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  maburoe | 
| 提出日時 | 2019-04-24 19:43:43 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 947 bytes | 
| コンパイル時間 | 342 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-11-08 19:30:56 | 
| 合計ジャッジ時間 | 1,312 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 8 WA * 2 | 
ソースコード
turns = int(input())
answer_list = list()
turn_list = list()
for _ in range(turns):
    turn = input().split()
    answer_list.append(turn[-1])
    # turn_list.append(list(map(int, turn[0:4])))
    turn_list.append(turn[0:4])
# print(answer_list)
# print(turn_list)
all_set = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
false_set = set()
maybe_true_set = set()
for i in range(turns):
    answer = answer_list[i]
    turn = turn_list[i]
    if answer == 'NO':
        false_set = set(turn).union(false_set)
        if len(maybe_true_set) > 0:
            maybe_true_set = maybe_true_set.difference(set(turn))
    else:
        if len(maybe_true_set) == 0:
            maybe_true_set = set(turn)
        else:
            maybe_true_set = maybe_true_set.intersection(set(turn))
# print(false_set)
# print(maybe_true_set)
if len(maybe_true_set) > 0:
    print(maybe_true_set.pop())
else:
    print(all_set.difference(false_set).pop())
            
            
            
        