結果

問題 No.709 優勝可能性
ユーザー convexineqconvexineq
提出日時 2021-03-18 16:39:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 377 ms / 3,500 ms
コード長 541 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 108,104 KB
最終ジャッジ日時 2024-04-28 06:40:38
合計ジャッジ時間 7,995 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,840 KB
testcase_01 AC 34 ms
52,096 KB
testcase_02 AC 35 ms
51,840 KB
testcase_03 AC 36 ms
52,224 KB
testcase_04 AC 35 ms
51,840 KB
testcase_05 AC 35 ms
52,224 KB
testcase_06 AC 36 ms
52,352 KB
testcase_07 AC 35 ms
51,584 KB
testcase_08 AC 35 ms
51,712 KB
testcase_09 AC 35 ms
52,352 KB
testcase_10 AC 314 ms
76,928 KB
testcase_11 AC 305 ms
77,448 KB
testcase_12 AC 346 ms
77,184 KB
testcase_13 AC 365 ms
77,824 KB
testcase_14 AC 365 ms
77,568 KB
testcase_15 AC 356 ms
77,312 KB
testcase_16 AC 369 ms
82,176 KB
testcase_17 AC 377 ms
108,104 KB
testcase_18 AC 34 ms
51,968 KB
testcase_19 AC 33 ms
52,224 KB
testcase_20 AC 363 ms
77,184 KB
testcase_21 AC 353 ms
76,800 KB
testcase_22 AC 35 ms
51,968 KB
testcase_23 AC 35 ms
51,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())

val = [0]*m
cnt = [0]*n
kouho = [[] for _ in range(m)]
ans = 0

for idx in range(n):
    *r, = map(int,input().split())
    for j,rj in enumerate(r):
        if val[j] < rj:
            val[j] = rj
            cnt[idx] += 1
            for i in kouho[j]:
                cnt[i] -= 1
                if cnt[i] == 0:
                    ans -= 1
            kouho[j] = [idx]

        elif val[j] == rj:
            cnt[idx] += 1
            kouho[j].append(idx)

    if cnt[idx]:
        ans += 1
    print(ans)
0