結果

問題 No.709 優勝可能性
ユーザー hedwig100hedwig100
提出日時 2020-05-03 16:25:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 709 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 10,808 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-09-03 15:48:40
合計ジャッジ時間 7,815 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,864 KB
testcase_01 AC 15 ms
7,804 KB
testcase_02 AC 13 ms
7,924 KB
testcase_03 AC 14 ms
7,848 KB
testcase_04 AC 15 ms
7,800 KB
testcase_05 AC 13 ms
7,804 KB
testcase_06 AC 14 ms
7,868 KB
testcase_07 AC 13 ms
7,812 KB
testcase_08 AC 12 ms
7,804 KB
testcase_09 AC 14 ms
7,804 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
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