結果

問題 No.3471 ジャッジサーバーの負荷分散
コンテスト
ユーザー urunea
提出日時 2026-03-06 23:03:43
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 307 ms / 2,000 ms
+ 917µs
コード長 323 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 236 ms
コンパイル使用メモリ 95,980 KB
実行使用メモリ 119,040 KB
最終ジャッジ日時 2026-07-27 07:15:44
合計ジャッジ時間 4,337 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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