結果

問題 No.709 優勝可能性
ユーザー 👑 KazunKazun
提出日時 2021-02-12 01:13:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 216 ms / 3,500 ms
コード長 703 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 87,176 KB
実行使用メモリ 105,208 KB
最終ジャッジ日時 2023-09-25 15:02:48
合計ジャッジ時間 5,909 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,336 KB
testcase_01 AC 72 ms
71,280 KB
testcase_02 AC 72 ms
71,384 KB
testcase_03 AC 71 ms
71,212 KB
testcase_04 AC 71 ms
71,444 KB
testcase_05 AC 73 ms
71,284 KB
testcase_06 AC 72 ms
71,528 KB
testcase_07 AC 73 ms
71,228 KB
testcase_08 AC 73 ms
71,456 KB
testcase_09 AC 75 ms
71,280 KB
testcase_10 AC 145 ms
79,852 KB
testcase_11 AC 118 ms
79,720 KB
testcase_12 AC 176 ms
80,420 KB
testcase_13 AC 188 ms
79,532 KB
testcase_14 AC 184 ms
79,956 KB
testcase_15 AC 191 ms
79,836 KB
testcase_16 AC 196 ms
84,032 KB
testcase_17 AC 216 ms
105,208 KB
testcase_18 AC 73 ms
71,356 KB
testcase_19 AC 73 ms
71,408 KB
testcase_20 AC 196 ms
79,532 KB
testcase_21 AC 197 ms
79,808 KB
testcase_22 AC 72 ms
71,380 KB
testcase_23 AC 73 ms
71,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
write=sys.stdout.write

N,M=map(int,input().split())

Count =[0]*(M+1)
Chance=[0]*N
Max   =[-1]*M
Person=[[] for _ in range(M)]

X=[0]*N
for k in range(N):
    R=list(map(int,input().split()))

    Count[0]+=1
    for j in range(M):
        if R[j]>=Max[j]:
            Count[Chance[k]]-=1
            Chance[k]+=1
            Count[Chance[k]]+=1

        if R[j]==Max[j]:
            Person[j].append(k)
        elif R[j]>Max[j]:
            for t in Person[j]:
                Count[Chance[t]]-=1
                Chance[t]-=1
                Count[Chance[t]]+=1

            Max[j]=R[j]
            Person[j]=[k]

    X[k]=k+1-Count[0]

write("\n".join(map(str,X)))
0