結果

問題 No.24 数当てゲーム
ユーザー yoshi_kyoshi_k
提出日時 2017-09-18 22:17:05
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 640 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 8,572 KB
最終ジャッジ日時 2023-08-07 21:12:15
合計ジャッジ時間 1,147 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,496 KB
testcase_01 AC 20 ms
8,496 KB
testcase_02 AC 18 ms
8,500 KB
testcase_03 AC 19 ms
8,572 KB
testcase_04 AC 18 ms
8,488 KB
testcase_05 AC 19 ms
8,428 KB
testcase_06 AC 18 ms
8,496 KB
testcase_07 AC 18 ms
8,500 KB
testcase_08 AC 19 ms
8,484 KB
testcase_09 AC 18 ms
8,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict

try:
    import mydebug

    def dprint(*objects):
        print(*objects)
except:
    def dprint(*objects, sep='', end='\n'): pass

n = int(input())
l = [0, 0, 0, 0]
dic = defaultdict(int)
for i in range(1, 10):
    dic[i] = 0
for i in range(n):
    a, b, c, d, r = input().split()
    dprint(a,b,c,d,r)
    if "YES" in r:
        diff = 1
    else:
        diff = -1
    dic[int(a)] += diff
    dic[int(b)] += diff
    dic[int(c)] += diff
    dic[int(d)] += diff

maxn = -20000000
ans = -2000
for k, v in dic.items():
    if maxn < dic[k]:
        maxn = dic[k]
        ans = k

print(ans)
0