結果
問題 |
No.709 優勝可能性
|
ユーザー |
![]() |
提出日時 | 2022-09-25 05:12:56 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 391 ms / 3,500 ms |
コード長 | 669 bytes |
コンパイル時間 | 1,203 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 105,708 KB |
最終ジャッジ日時 | 2024-12-22 12:43:50 |
合計ジャッジ時間 | 8,007 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)