結果

問題 No.709 優勝可能性
ユーザー H20
提出日時 2021-01-20 11:11:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 516 ms / 3,500 ms
コード長 516 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 166,308 KB
最終ジャッジ日時 2024-12-22 21:00:59
合計ジャッジ時間 6,424 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
MAXN = []
[MAXN.append([])for _ in range(M)]
MAXV = [0]*M
ans = 0
for i in range(N):
   L = (list(map(int,input().split())))
   same = False
   update = False
   for j in range(M):
      if MAXV[j]==L[j]:
         MAXN[j].append(i)
         same = True
      elif MAXV[j]<L[j]:
         MAXN[j]=[i]
         MAXV[j]=L[j]
         update = True
   if same:
      ans+=1
   if update:
      ANS = []
      for j in range(M):
         ANS+=MAXN[j]
      ans = len(set(ANS))
   print(ans)
0