結果

問題 No.706 多眼生物の調査
ユーザー _KingdomOfMoray_KingdomOfMoray
提出日時 2020-01-03 09:55:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 10,752 KB
実行使用メモリ 9,068 KB
最終ジャッジ日時 2023-08-14 19:06:39
合計ジャッジ時間 829 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,580 KB
testcase_01 AC 16 ms
8,424 KB
testcase_02 AC 16 ms
8,432 KB
testcase_03 AC 17 ms
8,424 KB
testcase_04 AC 16 ms
8,476 KB
testcase_05 AC 17 ms
8,564 KB
testcase_06 AC 18 ms
9,068 KB
testcase_07 AC 18 ms
8,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

n = int(input())
s_list = [input() for i in range(n)]

max_freq = -1
max_key = -1
s_clc = collections.Counter(s_list)

for key in s_clc.keys():
    if s_clc[key] > max_freq:
        max_freq = s_clc[key]
        max_key = len(key)
    elif s_clc[key] == max_freq and len(key) > max_key:
        max_key = len(key)
    
print(max_key - 2)
0