結果

問題 No.9 モンスターのレベル上げ
ユーザー yuki2006_kdyuki2006_kd
提出日時 2014-10-12 08:21:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 594 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 10,820 KB
実行使用メモリ 18,344 KB
最終ジャッジ日時 2023-08-28 20:50:36
合計ジャッジ時間 32,445 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
18,344 KB
testcase_01 AC 20 ms
8,868 KB
testcase_02 TLE -
testcase_03 AC 4,202 ms
9,388 KB
testcase_04 AC 2,288 ms
9,368 KB
testcase_05 AC 1,581 ms
9,192 KB
testcase_06 AC 494 ms
8,976 KB
testcase_07 AC 31 ms
8,648 KB
testcase_08 AC 671 ms
9,140 KB
testcase_09 TLE -
testcase_10 AC 20 ms
8,764 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
from collections import deque
from copy import deepcopy
d = deque()
n = int(input())

a = []

for i in (input().split()):
    heapq.heappush(a,[int(i),0])
b = deque(list(map(int, input().split())))
c = n
ans = 0xFFFFFFFF

while (c):
    tmp = deepcopy(a)
    mx = 0
    mn = 0xFFFFFFFF
    count = 0
    for bi in range(len(b)):
        t = heapq.heappop(tmp)
        t[0] += b[(c+bi)%n] >> 1
        t[1] += 1
        mx = max(mx, t[1])
        if mx >= ans:
           break
        heapq.heappush(tmp, t)
    c -= 1
    ans = min(ans, mx)
print(ans)
0