結果
問題 | No.709 優勝可能性 |
ユーザー |
![]() |
提出日時 | 2023-03-16 12:41:43 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 181 ms / 3,500 ms |
コード長 | 738 bytes |
コンパイル時間 | 285 ms |
コンパイル使用メモリ | 82,540 KB |
実行使用メモリ | 103,788 KB |
最終ジャッジ日時 | 2024-09-18 09:18:55 |
合計ジャッジ時間 | 5,143 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
import sysreadline = sys.stdin.readlineN, M = map(int, readline().split())maxv = list(map(int, readline().split()))cnt = [0] * Ncnt[0] = Mans = 1L = [[0] for i in range(10)]print(1)for i in range(1, N):now = list(map(int, readline().split()))for j in range(M):if now[j] > maxv[j]:maxv[j] = now[j]while L[j]:v = L[j].pop()cnt[v] -= 1if cnt[v] == 0:ans -= 1cnt[i] += 1if cnt[i] == 1:ans += 1L[j].append(i)elif now[j] == maxv[j]:L[j].append(i)cnt[i] += 1if cnt[i] == 1:ans += 1print(ans)