結果

問題 No.709 優勝可能性
ユーザー 👑 H20H20
提出日時 2021-01-20 11:11:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 498 ms / 3,500 ms
コード長 516 bytes
コンパイル時間 792 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 146,456 KB
最終ジャッジ日時 2023-08-24 13:41:19
合計ジャッジ時間 8,391 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,132 KB
testcase_01 AC 72 ms
71,204 KB
testcase_02 AC 70 ms
71,428 KB
testcase_03 AC 71 ms
71,180 KB
testcase_04 AC 71 ms
71,200 KB
testcase_05 AC 71 ms
71,456 KB
testcase_06 AC 70 ms
71,180 KB
testcase_07 AC 70 ms
70,884 KB
testcase_08 AC 70 ms
71,184 KB
testcase_09 AC 70 ms
71,256 KB
testcase_10 AC 366 ms
77,632 KB
testcase_11 AC 334 ms
78,856 KB
testcase_12 AC 378 ms
77,728 KB
testcase_13 AC 455 ms
78,300 KB
testcase_14 AC 419 ms
77,812 KB
testcase_15 AC 436 ms
78,240 KB
testcase_16 AC 490 ms
97,384 KB
testcase_17 AC 498 ms
146,456 KB
testcase_18 AC 70 ms
71,208 KB
testcase_19 AC 70 ms
71,412 KB
testcase_20 AC 402 ms
77,360 KB
testcase_21 AC 390 ms
77,700 KB
testcase_22 AC 70 ms
71,116 KB
testcase_23 AC 70 ms
71,376 KB
権限があれば一括ダウンロードができます

ソースコード

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