結果

問題 No.709 優勝可能性
ユーザー rlangevinrlangevin
提出日時 2023-03-16 12:41:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 207 ms / 3,500 ms
コード長 738 bytes
コンパイル時間 1,468 ms
コンパイル使用メモリ 81,476 KB
実行使用メモリ 103,440 KB
最終ジャッジ日時 2023-10-18 12:59:01
合計ジャッジ時間 5,714 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,372 KB
testcase_01 AC 38 ms
53,372 KB
testcase_02 AC 37 ms
53,372 KB
testcase_03 AC 37 ms
53,372 KB
testcase_04 AC 37 ms
53,372 KB
testcase_05 AC 37 ms
53,372 KB
testcase_06 AC 37 ms
53,372 KB
testcase_07 AC 37 ms
53,372 KB
testcase_08 AC 37 ms
53,372 KB
testcase_09 AC 37 ms
53,372 KB
testcase_10 AC 122 ms
77,068 KB
testcase_11 AC 103 ms
77,036 KB
testcase_12 AC 162 ms
77,376 KB
testcase_13 AC 188 ms
78,392 KB
testcase_14 AC 176 ms
77,828 KB
testcase_15 AC 175 ms
77,532 KB
testcase_16 AC 186 ms
79,592 KB
testcase_17 AC 207 ms
103,440 KB
testcase_18 AC 36 ms
53,408 KB
testcase_19 AC 36 ms
53,408 KB
testcase_20 AC 181 ms
78,016 KB
testcase_21 AC 184 ms
78,004 KB
testcase_22 AC 37 ms
53,408 KB
testcase_23 AC 37 ms
53,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline

N, M = map(int, readline().split())
maxv = list(map(int, readline().split()))
cnt = [0] * N
cnt[0] = M
ans = 1
L = [[0] for i in range(10)]
print(1)
for i in range(1, N):
    now = list(map(int, readline().split()))
    for j in range(M):
        if now[j] > maxv[j]:
            maxv[j] = now[j]
            while L[j]:
                v = L[j].pop()
                cnt[v] -= 1
                if cnt[v] == 0:
                    ans -= 1
            cnt[i] += 1
            if cnt[i] == 1:
                ans += 1
            L[j].append(i)
        elif now[j] == maxv[j]:
            L[j].append(i)
            cnt[i] += 1
            if cnt[i] == 1:
                ans += 1

    print(ans)
0