結果
| 問題 | 
                            No.709 優勝可能性
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-08-22 13:39:56 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 713 bytes | 
| コンパイル時間 | 92 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 35,584 KB | 
| 最終ジャッジ日時 | 2024-12-23 20:17:02 | 
| 合計ジャッジ時間 | 27,149 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 18 TLE * 4 | 
ソースコード
def solve(N, M, Rs):
    ans = []
    maxes = {m: [0, set()] for m in range(0, M)}
    for ri, r in enumerate(Rs):
        for m, cr in enumerate(r.split(" ")):
            cmax = maxes[m][0]
            p = int(cr)
            if p > cmax:
                maxes[m][0] = p
                maxes[m][1] = set()
                maxes[m][1].add(ri)
            elif p == cmax:
                maxes[m][1].add(ri)
        count = set()
        for mm in maxes.values():
            count.update(mm[1])
        ans.append(len(count))
    return ans
if __name__ == "__main__":
    l = input().split(" ")
    N, M = int(l[0]), int(l[1])
    Rs = [input() for _ in range(0, N)]
    [print(s) for s in solve(N, M, Rs)]