結果

問題 No.709 優勝可能性
ユーザー kohei2019kohei2019
提出日時 2022-03-21 11:58:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 397 ms / 3,500 ms
コード長 724 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 158,108 KB
最終ジャッジ日時 2024-10-08 16:19:21
合計ジャッジ時間 6,777 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
lsR = [list(map(int,input().split())) for i in range(N)]
lsTF = []
cnt = 0
lsmax = [[-float('INF')] for i in range(M)]

for i in range(N):
    cnt += 1
    lsp = lsR[i]
    TF = [True]*(M)
    remls = set()
    for j in range(M):
        if lsmax[j][0] > lsp[j]:
            TF[j] = False
        elif lsmax[j][0] == lsp[j]:
            lsmax[j].append(i)
        else:
            lose = lsmax[j][1:]
            for k in lose:
                lsTF[k][j] = False
                remls.add(k)
            lsmax[j] = [lsp[j],i]
    for rem in remls:
        if lsTF[rem].count(True) == 0:
            cnt -= 1
    if TF.count(True) == 0:
        cnt -= 1
    lsTF.append(TF)
    print(cnt)
    
0