結果

問題 No.709 優勝可能性
ユーザー kohei2019kohei2019
提出日時 2022-03-21 11:58:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 459 ms / 3,500 ms
コード長 724 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 158,112 KB
最終ジャッジ日時 2024-04-17 05:08:37
合計ジャッジ時間 6,752 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
51,840 KB
testcase_01 AC 41 ms
52,096 KB
testcase_02 AC 42 ms
51,712 KB
testcase_03 AC 42 ms
51,840 KB
testcase_04 AC 43 ms
51,840 KB
testcase_05 AC 44 ms
51,968 KB
testcase_06 AC 44 ms
52,096 KB
testcase_07 AC 43 ms
51,968 KB
testcase_08 AC 43 ms
52,224 KB
testcase_09 AC 41 ms
52,096 KB
testcase_10 AC 237 ms
99,712 KB
testcase_11 AC 216 ms
96,128 KB
testcase_12 AC 351 ms
102,816 KB
testcase_13 AC 374 ms
115,100 KB
testcase_14 AC 338 ms
113,416 KB
testcase_15 AC 357 ms
112,836 KB
testcase_16 AC 419 ms
121,724 KB
testcase_17 AC 459 ms
158,112 KB
testcase_18 AC 43 ms
51,712 KB
testcase_19 AC 43 ms
51,968 KB
testcase_20 AC 319 ms
113,988 KB
testcase_21 AC 334 ms
114,188 KB
testcase_22 AC 42 ms
51,968 KB
testcase_23 AC 43 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

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