結果

問題 No.709 優勝可能性
ユーザー hedwig100hedwig100
提出日時 2020-05-03 16:25:45
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 709 bytes
コンパイル時間 583 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 171,444 KB
最終ジャッジ日時 2023-09-03 15:49:26
合計ジャッジ時間 7,110 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
70,844 KB
testcase_01 AC 62 ms
70,768 KB
testcase_02 AC 65 ms
71,092 KB
testcase_03 AC 65 ms
70,916 KB
testcase_04 AC 64 ms
71,116 KB
testcase_05 AC 66 ms
71,292 KB
testcase_06 AC 62 ms
70,864 KB
testcase_07 AC 62 ms
70,880 KB
testcase_08 AC 62 ms
71,184 KB
testcase_09 AC 62 ms
70,780 KB
testcase_10 AC 3,187 ms
171,444 KB
testcase_11 AC 275 ms
104,672 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n,m = map(int,input().split())
    paramter = [list(map(int,input().split())) for _ in range(n)]

    winner = [[None]*n for _ in range(m)]
    for i in range(m):
        M = 0
        for j in range(n):
            if paramter[j][i] > M:
                M = paramter[j][i]
                winner[i][j] = {j}
            elif paramter[j][i] == M:
                winner[i][j] = winner[i][j - 1] | {j}
            else:
                winner[i][j] = winner[i][j - 1]
    
    ans = [None] * n
    for i in range(n):
        win = set()
        for j in range(m):
            win |= winner[j][i]
        ans[i] = len(win)
    print('\n'.join(map(str,ans)))
if __name__ == '__main__':
    main()
0