結果

問題 No.9 モンスターのレベル上げ
ユーザー ゆるくゆるく
提出日時 2014-10-12 05:46:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 650 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 9,008 KB
最終ジャッジ日時 2023-08-28 20:44:12
合計ジャッジ時間 10,400 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,616 KB
testcase_01 AC 19 ms
8,628 KB
testcase_02 AC 1,356 ms
8,820 KB
testcase_03 AC 996 ms
8,824 KB
testcase_04 WA -
testcase_05 AC 423 ms
8,768 KB
testcase_06 AC 107 ms
8,676 KB
testcase_07 AC 20 ms
8,708 KB
testcase_08 AC 165 ms
8,612 KB
testcase_09 AC 1,203 ms
8,932 KB
testcase_10 AC 18 ms
8,596 KB
testcase_11 AC 1,335 ms
9,008 KB
testcase_12 WA -
testcase_13 AC 65 ms
8,676 KB
testcase_14 WA -
testcase_15 AC 1,238 ms
8,860 KB
testcase_16 AC 31 ms
8,680 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

a = []

for i in (input().split()):
    heapq.heappush(a,((int(i) << 4) + 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 & 0x0F
        bm = t >> 4
        bm += bb >> 1
        am += 1
        if am >= ans:
            break
        mxlist[index] = am
        index += 1
        heapq.heappush(tmp, (bm << 4) + am)
    c -= 1
    ans = min(ans, max(mxlist))
    b.rotate(1)
print(ans)
0