結果

問題 No.24 数当てゲーム
ユーザー naoe123naoe123
提出日時 2020-01-26 09:08:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 789 bytes
コンパイル時間 1,372 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 8,716 KB
最終ジャッジ日時 2023-10-12 11:54:56
合計ジャッジ時間 1,356 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,572 KB
testcase_01 WA -
testcase_02 AC 18 ms
8,640 KB
testcase_03 AC 18 ms
8,564 KB
testcase_04 AC 19 ms
8,700 KB
testcase_05 RE -
testcase_06 AC 18 ms
8,680 KB
testcase_07 AC 18 ms
8,508 KB
testcase_08 AC 18 ms
8,636 KB
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
y_l=[]
n_l=[]
default=[0,1,2,3,4,5,6,7,8,9]
for i in range(N):
    A,B,C,D,R=input().split()
    A=int(A)
    B=int(B)
    C=int(C)
    D=int(D)
    if R=='NO':
        try:
            default.remove(A)
        except:
            pass
        try:
            default.remove(B)
        except:
            pass
        try:
            default.remove(C)
        except:
            pass
        try:
            default.remove(D)
        except:
            pass
    else:
        y_l.append(A)
        y_l.append(B)
        y_l.append(C)
        y_l.append(D)

import collections
c=collections.Counter(y_l)

if len(default)==1:
    print(default[0])
else:
    kaisu=c.most_common()[0][1]
    y_l=[i for i in y_l if i>=kaisu]
    print(list(set(default)&set(y_l))[0])




0