結果

問題 No.709 優勝可能性
ユーザー H3PO4H3PO4
提出日時 2020-12-09 21:36:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 193 ms / 3,500 ms
コード長 612 bytes
コンパイル時間 961 ms
コンパイル使用メモリ 81,752 KB
実行使用メモリ 99,448 KB
最終ジャッジ日時 2023-10-19 08:01:55
合計ジャッジ時間 4,173 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,308 KB
testcase_01 AC 42 ms
53,308 KB
testcase_02 AC 41 ms
53,308 KB
testcase_03 AC 41 ms
53,308 KB
testcase_04 AC 40 ms
53,308 KB
testcase_05 AC 40 ms
53,308 KB
testcase_06 AC 40 ms
53,308 KB
testcase_07 AC 40 ms
53,308 KB
testcase_08 AC 40 ms
53,308 KB
testcase_09 AC 40 ms
53,308 KB
testcase_10 AC 113 ms
76,464 KB
testcase_11 AC 95 ms
76,504 KB
testcase_12 AC 150 ms
76,900 KB
testcase_13 AC 184 ms
77,596 KB
testcase_14 AC 171 ms
77,228 KB
testcase_15 AC 172 ms
77,220 KB
testcase_16 AC 183 ms
80,416 KB
testcase_17 AC 193 ms
99,448 KB
testcase_18 AC 40 ms
53,320 KB
testcase_19 AC 40 ms
53,320 KB
testcase_20 AC 181 ms
77,164 KB
testcase_21 AC 181 ms
77,168 KB
testcase_22 AC 39 ms
53,320 KB
testcase_23 AC 39 ms
53,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.readline

N, M = map(int, input().split())
max_param = [0] * M
winners = [[] for _ in range(M)]
people = [0] * N
ans = 0
for i in range(N):
    R = map(int, input().split())
    for j, r in enumerate(R):
        if max_param[j] < r:
            for x in winners[j]:
                people[x] -= 1
                if not people[x]:
                    ans -= 1
            winners[j].clear()

            max_param[j] = r

        if max_param[j] == r:
            if not people[i]:
                ans += 1
            people[i] += 1

            winners[j].append(i)
    print(ans)
0