結果

問題 No.709 優勝可能性
ユーザー H3PO4H3PO4
提出日時 2020-12-09 21:37:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 759 ms / 3,500 ms
コード長 619 bytes
コンパイル時間 653 ms
コンパイル使用メモリ 11,792 KB
実行使用メモリ 18,548 KB
最終ジャッジ日時 2023-10-19 08:03:24
合計ジャッジ時間 7,868 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,076 KB
testcase_01 AC 29 ms
10,076 KB
testcase_02 AC 30 ms
10,076 KB
testcase_03 AC 30 ms
10,076 KB
testcase_04 AC 30 ms
10,076 KB
testcase_05 AC 30 ms
10,076 KB
testcase_06 AC 31 ms
10,076 KB
testcase_07 AC 31 ms
10,076 KB
testcase_08 AC 31 ms
10,076 KB
testcase_09 AC 30 ms
10,076 KB
testcase_10 AC 294 ms
11,000 KB
testcase_11 AC 204 ms
11,024 KB
testcase_12 AC 467 ms
11,208 KB
testcase_13 AC 655 ms
11,104 KB
testcase_14 AC 596 ms
11,016 KB
testcase_15 AC 589 ms
10,872 KB
testcase_16 AC 654 ms
12,328 KB
testcase_17 AC 759 ms
18,548 KB
testcase_18 AC 30 ms
10,076 KB
testcase_19 AC 30 ms
10,076 KB
testcase_20 AC 599 ms
11,004 KB
testcase_21 AC 610 ms
11,004 KB
testcase_22 AC 30 ms
10,076 KB
testcase_23 AC 31 ms
10,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.buffer.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