結果
| 問題 |
No.709 優勝可能性
|
| コンテスト | |
| ユーザー |
lllllll88938494
|
| 提出日時 | 2022-09-25 05:17:00 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 423 ms / 3,500 ms |
| コード長 | 814 bytes |
| コンパイル時間 | 255 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 105,668 KB |
| 最終ジャッジ日時 | 2024-12-22 12:43:57 |
| 合計ジャッジ時間 | 6,299 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
n,m=map(int,input().split())
s=[[] for i in range(m)]#各パラメーターごとの最高値保持者リスト
maxnum=[0]*m#各パラメーターの最高値
ncnt=[0]*n#各人の最高値保有個数
now=0#最高値保持者数
for i in range(n):
a=list(map(int,input().split()))
for j in range(m):
if a[j] == maxnum[j]:
s[j].append(i)
if ncnt[i] == 0:
now+=1
ncnt[i] += 1
elif a[j] > maxnum[j]:
for k in range(len(s[j])):
t=s[j].pop()
ncnt[t] -= 1
if ncnt[t] == 0:
now -= 1
s[j].append(i)
if ncnt[i] == 0:
now+=1
ncnt[i] += 1
maxnum[j] = a[j]
print(now)
lllllll88938494