結果
問題 | No.709 優勝可能性 |
ユーザー |
![]() |
提出日時 | 2018-07-15 15:25:53 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,661 ms / 3,500 ms |
コード長 | 685 bytes |
コンパイル時間 | 298 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 43,256 KB |
最終ジャッジ日時 | 2024-11-06 13:41:30 |
合計ジャッジ時間 | 15,316 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
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)