結果

問題 No.24 数当てゲーム
ユーザー notsix4notsix4
提出日時 2021-11-24 00:10:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 478 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 8,588 KB
最終ジャッジ日時 2023-09-08 04:46:39
合計ジャッジ時間 1,412 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,480 KB
testcase_01 AC 18 ms
8,472 KB
testcase_02 AC 18 ms
8,516 KB
testcase_03 AC 18 ms
8,584 KB
testcase_04 AC 18 ms
8,584 KB
testcase_05 AC 18 ms
8,448 KB
testcase_06 AC 18 ms
8,584 KB
testcase_07 AC 18 ms
8,588 KB
testcase_08 AC 18 ms
8,588 KB
testcase_09 AC 18 ms
8,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
n=int(input())
l=[i for i in range(10)]
nl=[]
for i in range(n):
    s=input().split()
    if s[4]=="NO":
        t=list(map(int,s[:4]))
        for j in t:
            if j in l:
                l.remove(j)
    elif s[4]=="YES":
        t=list(map(int,s[:4]))
        for j in t:
            if j in l:
                nl.append(j)

if len(l)==1:
    print(l[0])
else:
    dd = collections.Counter([x for x in nl if x in l])
    print(dd.most_common()[0][0])
0