結果

問題 No.709 優勝可能性
ユーザー AEnAEn
提出日時 2022-06-21 20:47:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 399 ms / 3,500 ms
コード長 624 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 107,392 KB
最終ジャッジ日時 2023-08-04 18:23:05
合計ジャッジ時間 7,587 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,304 KB
testcase_01 AC 69 ms
71,412 KB
testcase_02 AC 69 ms
71,292 KB
testcase_03 AC 68 ms
71,312 KB
testcase_04 AC 69 ms
71,156 KB
testcase_05 AC 69 ms
71,068 KB
testcase_06 AC 68 ms
71,088 KB
testcase_07 AC 69 ms
71,060 KB
testcase_08 AC 68 ms
71,284 KB
testcase_09 AC 69 ms
71,228 KB
testcase_10 AC 331 ms
78,100 KB
testcase_11 AC 305 ms
79,408 KB
testcase_12 AC 348 ms
78,260 KB
testcase_13 AC 380 ms
78,468 KB
testcase_14 AC 366 ms
78,212 KB
testcase_15 AC 367 ms
78,392 KB
testcase_16 AC 387 ms
82,684 KB
testcase_17 AC 399 ms
107,392 KB
testcase_18 AC 68 ms
71,028 KB
testcase_19 AC 71 ms
71,376 KB
testcase_20 AC 368 ms
78,216 KB
testcase_21 AC 378 ms
78,112 KB
testcase_22 AC 69 ms
71,116 KB
testcase_23 AC 67 ms
70,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
m = [0]*M
n = [[] for _ in range(M)]
cnt = [0]*N
res = 0
for i in range(N):
    R = list(map(int, input().split()))
    for j in range(M):
        if m[j] < R[j]:
            m[j] = R[j]
            for nn in n[j]:
                if cnt[nn] == 1:
                    cnt[nn] = 0
                    res -= 1
                else:
                    cnt[nn] -= 1
            n[j] = []
        if m[j] == R[j]:
            if cnt[i] == 0:
                cnt[i] = 1
                res += 1
            else:
                cnt[i] += 1
            n[j].append(i)
    print(res)



        
0