結果

問題 No.709 優勝可能性
ユーザー Mr.FukuMr.Fuku
提出日時 2018-07-15 15:25:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,536 ms / 3,500 ms
コード長 685 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 41,936 KB
最終ジャッジ日時 2023-08-06 10:38:43
合計ジャッジ時間 13,331 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,760 KB
testcase_01 AC 16 ms
7,816 KB
testcase_02 AC 17 ms
7,772 KB
testcase_03 AC 15 ms
7,712 KB
testcase_04 AC 16 ms
7,764 KB
testcase_05 AC 17 ms
7,772 KB
testcase_06 AC 16 ms
7,904 KB
testcase_07 AC 16 ms
7,920 KB
testcase_08 AC 16 ms
7,776 KB
testcase_09 AC 16 ms
7,708 KB
testcase_10 AC 744 ms
8,316 KB
testcase_11 AC 641 ms
7,820 KB
testcase_12 AC 923 ms
8,308 KB
testcase_13 AC 1,285 ms
7,784 KB
testcase_14 AC 1,125 ms
8,360 KB
testcase_15 AC 1,060 ms
8,712 KB
testcase_16 AC 1,264 ms
14,212 KB
testcase_17 AC 1,536 ms
41,936 KB
testcase_18 AC 16 ms
7,900 KB
testcase_19 AC 16 ms
7,792 KB
testcase_20 AC 1,056 ms
7,792 KB
testcase_21 AC 1,067 ms
7,848 KB
testcase_22 AC 16 ms
7,940 KB
testcase_23 AC 16 ms
7,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
max_status = [0]*m
candidate = [0]*m
count = 0
top_change = False
top_tie = False

for i in range(n):
    status = list(map(int,input().split()))
    for j in range(m):
        if status[j]>max_status[j]:
            max_status[j] = status[j]
            candidate[j] = [i+1]
            top_change = True
        elif status[j]==max_status[j]:
            candidate[j] += [i+1]
            top_tie = True
    
    if top_change:
        ans = []
        for j in candidate:
            ans += j
        count = len(set(ans))
        top_change = False
        top_tie = False
    elif top_tie:
        count += 1
        top_tie = False
    print(count)
0