結果

問題 No.9 モンスターのレベル上げ
ユーザー ゆるくゆるく
提出日時 2014-10-12 16:31:17
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 650 bytes
コンパイル時間 63 ms
使用メモリ 8,500 KB
最終ジャッジ日時 2023-01-16 07:43:31
合計ジャッジ時間 12,808 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 19 ms
8,048 KB
testcase_01 AC 18 ms
7,860 KB
testcase_02 AC 1,434 ms
8,424 KB
testcase_03 AC 1,080 ms
8,396 KB
testcase_04 AC 612 ms
8,040 KB
testcase_05 AC 449 ms
8,260 KB
testcase_06 AC 118 ms
7,976 KB
testcase_07 AC 21 ms
8,060 KB
testcase_08 AC 167 ms
8,056 KB
testcase_09 AC 1,256 ms
8,500 KB
testcase_10 AC 18 ms
8,012 KB
testcase_11 AC 1,391 ms
8,472 KB
testcase_12 WA -
testcase_13 AC 69 ms
8,368 KB
testcase_14 AC 1,230 ms
8,404 KB
testcase_15 AC 1,314 ms
8,480 KB
testcase_16 AC 33 ms
8,104 KB
testcase_17 AC 892 ms
8,292 KB
testcase_18 AC 734 ms
8,200 KB
testcase_19 AC 35 ms
7,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

a = []

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

mxlist = [0] * n
while (c):
    tmp = list(a)
    mx = 0
    index = 0
    for bb in b:
        t = heapq.heappop(tmp)
        am = t & 0xFF
        bm = t >> 8
        bm += bb >> 1
        am += 1
        mxlist[index] = am
        if am >= ans:
            break
        index += 1
        heapq.heappush(tmp, (bm << 8) + am)
    c -= 1
    ans = min(ans, max(mxlist))
    b.rotate(1)
print(ans)
0