結果

問題 No.706 多眼生物の調査
ユーザー maspymaspy
提出日時 2020-01-18 17:55:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 572 ms
コンパイル使用メモリ 10,488 KB
実行使用メモリ 8,964 KB
最終ジャッジ日時 2023-09-10 07:02:33
合計ジャッジ時間 1,288 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,468 KB
testcase_01 AC 19 ms
8,612 KB
testcase_02 AC 18 ms
8,604 KB
testcase_03 AC 19 ms
8,556 KB
testcase_04 AC 19 ms
8,512 KB
testcase_05 AC 19 ms
8,736 KB
testcase_06 AC 20 ms
8,964 KB
testcase_07 AC 18 ms
8,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from collections import Counter

N = int(readline())
data = [line.count(b'^') for line in readlines()]

max_cnt = 0
answer = 0
for key, cnt in Counter(data).items():
    if max_cnt < cnt:
        max_cnt = cnt
        answer = key
    elif max_cnt == cnt:
        if answer < key:
            answer = key

print(answer)
0