結果

問題 No.24 数当てゲーム
ユーザー R N
提出日時 2020-08-05 08:45:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 53 ms / 5,000 ms
コード長 695 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 13,824 KB
最終ジャッジ日時 2024-09-15 18:30:16
合計ジャッジ時間 1,990 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding:utf-8

import statistics
import collections

n = int(input())

taro_list = []
yes_count= 0
yes_num = []
no_num = []

for i in range(n):
    taro_list.append(input().split())


for j in range(n):
    for k in range(4):
        if taro_list[j][4] == 'NO':
            no_num.append(taro_list[j][k])
        else:
            yes_num.append(taro_list[j][k])
            yes_count += 1

if len(yes_num) == 0:
    a = [str(l) for l in range(10)]
    ans = set(a) - set(no_num)
    print(*ans)

elif len(no_num) == 0:
    ans = statistics.mode(yes_num)
    print(*ans)

else:
    a = [str(l) for l in yes_num if yes_num.count(l) == yes_count//4]
    ans = set(a) - set(no_num)
    print(*ans)
0