結果

問題 No.3471 ジャッジサーバーの負荷分散
コンテスト
ユーザー urunea
提出日時 2026-03-06 23:03:43
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 518 ms / 2,000 ms
コード長 323 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 322 ms
コンパイル使用メモリ 85,096 KB
実行使用メモリ 117,572 KB
最終ジャッジ日時 2026-03-06 23:03:49
合計ジャッジ時間 4,013 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import heapq

N, M = (int(x) for x in input().split())
T=list(map(int, input().split()))
L=[]
heapq.heapify(L)
for i in range(1, M+1):
    heapq.heappush(L, (0, i))

for i in T:
    p, idx = heapq.heappop(L)
    heapq.heappush(L, (p+i, idx))

ans = 0
while L:
    p, idx = heapq.heappop(L)
    ans = max(ans, p)

print(ans)
0