結果

問題 No.9 モンスターのレベル上げ
ユーザー ゆるくゆるく
提出日時 2014-10-12 05:22:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 653 bytes
コンパイル時間 824 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 9,116 KB
最終ジャッジ日時 2023-08-28 20:50:03
合計ジャッジ時間 19,030 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,700 KB
testcase_01 AC 19 ms
8,764 KB
testcase_02 AC 2,156 ms
9,116 KB
testcase_03 AC 1,651 ms
8,916 KB
testcase_04 AC 959 ms
9,084 KB
testcase_05 AC 661 ms
8,892 KB
testcase_06 AC 200 ms
8,840 KB
testcase_07 AC 24 ms
8,724 KB
testcase_08 AC 272 ms
8,840 KB
testcase_09 AC 1,951 ms
8,972 KB
testcase_10 AC 19 ms
8,756 KB
testcase_11 AC 2,169 ms
9,104 KB
testcase_12 WA -
testcase_13 AC 700 ms
9,020 KB
testcase_14 AC 1,950 ms
9,064 KB
testcase_15 AC 1,945 ms
9,108 KB
testcase_16 AC 48 ms
8,736 KB
testcase_17 AC 1,336 ms
8,884 KB
testcase_18 AC 1,090 ms
8,908 KB
testcase_19 AC 45 ms
8,736 KB
権限があれば一括ダウンロードができます

ソースコード

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) << 4) + 0))
b = deque(list(map(int, input().split())))
c = n
ans = 0xFFFFFFFF

while (c):
    tmp = deepcopy(a)
    mx = 0
    mn = 0xFFFFFFFF
    count = 0
    for bb in b:
        t = heapq.heappop(tmp)
        am = t & 0x0F
        bm = t >> 4
        bm += bb >> 1
        am += 1
        mx = max(mx, am)
        if mx >= ans:
            break
        heapq.heappush(tmp, (bm << 4) + am)
    c -= 1
    ans = min(ans, mx)
    b.rotate(1)
print(ans)
0