結果

問題 No.709 優勝可能性
ユーザー zxc1113
提出日時 2018-07-06 03:40:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,148 ms / 3,500 ms
コード長 811 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 71,424 KB
最終ジャッジ日時 2024-07-01 02:43:42
合計ジャッジ時間 11,924 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = list(map(int, input().split()))
people = []
for i in range(n):
    people.append(list(map(int,input().split())))
imos = [0]*n
buf = [0]*n
max_point = [0]*n
members = [[] for i in range(n)]
for i in range(n):  
    f = False  
    for ind, j in enumerate(people[i]):
        if max_point[ind] < j:
            f = True
            buf[i] += 1
            max_point[ind] = j
            for m in members[ind]:
                buf[m] -=1
                if buf[m] == 0:
                    imos[i] -=1
            members[ind] = [i]
        elif max_point[ind] == j:
            f = True
            buf[i] += 1
            members[ind].append(i)
        else:
            pass
    if f:
        imos[i] += 1
    #print(buf, imos, f)
for i in range(n-1):
    imos[i+1] += imos[i]
for i in imos:
    print(i)
0