結果

問題 No.709 優勝可能性
ユーザー convexineq
提出日時 2021-03-18 16:39:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 417 ms / 3,500 ms
コード長 541 bytes
コンパイル時間 1,357 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 107,860 KB
最終ジャッジ日時 2024-11-16 19:53:18
合計ジャッジ時間 8,243 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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