結果

問題 No.709 優勝可能性
ユーザー NoneNone
提出日時 2021-10-14 09:57:47
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 381 ms / 3,500 ms
コード長 545 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 81,668 KB
実行使用メモリ 99,664 KB
最終ジャッジ日時 2023-10-17 19:18:44
合計ジャッジ時間 5,594 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,416 KB
testcase_01 AC 40 ms
53,416 KB
testcase_02 AC 37 ms
53,416 KB
testcase_03 AC 38 ms
53,416 KB
testcase_04 AC 37 ms
53,416 KB
testcase_05 AC 38 ms
53,416 KB
testcase_06 AC 38 ms
53,416 KB
testcase_07 AC 37 ms
53,416 KB
testcase_08 AC 38 ms
53,416 KB
testcase_09 AC 37 ms
53,416 KB
testcase_10 AC 290 ms
76,548 KB
testcase_11 AC 273 ms
76,640 KB
testcase_12 AC 332 ms
76,692 KB
testcase_13 AC 354 ms
76,872 KB
testcase_14 AC 343 ms
76,872 KB
testcase_15 AC 346 ms
76,872 KB
testcase_16 AC 366 ms
80,476 KB
testcase_17 AC 381 ms
99,664 KB
testcase_18 AC 38 ms
53,416 KB
testcase_19 AC 37 ms
53,416 KB
testcase_20 AC 353 ms
76,620 KB
testcase_21 AC 355 ms
76,624 KB
testcase_22 AC 38 ms
53,416 KB
testcase_23 AC 38 ms
53,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int, input().split())
Max=[0]*M
List=[[] for _ in range(M)]
Cnt=[0]*N
cnt=0
for n in range(N):
    for i,r in enumerate(map(int, input().split())):
        if Max[i]<r:
            Max[i]=r
            for m in List[i]:
                Cnt[m]-=1
                if Cnt[m]==0:
                    cnt-=1
            List[i]=[n]
            if Cnt[n]==0:
                cnt+=1
            Cnt[n]+=1
        elif Max[i]==r:
            List[i].append(n)
            if Cnt[n]==0:
                cnt+=1
            Cnt[n]+=1
    print(cnt)
0