結果

問題 No.9 モンスターのレベル上げ
ユーザー ゆるくゆるく
提出日時 2014-10-12 16:31:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 650 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 8,836 KB
最終ジャッジ日時 2023-08-28 20:50:56
合計ジャッジ時間 12,586 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,588 KB
testcase_01 AC 18 ms
8,484 KB
testcase_02 AC 1,355 ms
8,760 KB
testcase_03 AC 1,032 ms
8,816 KB
testcase_04 AC 592 ms
8,776 KB
testcase_05 AC 428 ms
8,648 KB
testcase_06 AC 117 ms
8,572 KB
testcase_07 AC 22 ms
8,604 KB
testcase_08 AC 165 ms
8,596 KB
testcase_09 AC 1,211 ms
8,836 KB
testcase_10 AC 18 ms
8,484 KB
testcase_11 AC 1,361 ms
8,768 KB
testcase_12 WA -
testcase_13 AC 65 ms
8,720 KB
testcase_14 AC 1,174 ms
8,816 KB
testcase_15 AC 1,236 ms
8,724 KB
testcase_16 AC 33 ms
8,556 KB
testcase_17 AC 890 ms
8,708 KB
testcase_18 AC 714 ms
8,764 KB
testcase_19 AC 35 ms
8,616 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