結果

問題 No.9 モンスターのレベル上げ
ユーザー sue_charosue_charo
提出日時 2017-05-01 14:15:13
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 990 bytes
コンパイル時間 636 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 209,036 KB
最終ジャッジ日時 2023-10-12 02:04:34
合計ジャッジ時間 23,291 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 185 ms
79,668 KB
testcase_01 AC 186 ms
79,280 KB
testcase_02 TLE -
testcase_03 AC 4,128 ms
170,640 KB
testcase_04 AC 2,272 ms
119,452 KB
testcase_05 AC 1,597 ms
103,008 KB
testcase_06 AC 727 ms
88,104 KB
testcase_07 AC 262 ms
82,748 KB
testcase_08 AC 887 ms
91,456 KB
testcase_09 TLE -
testcase_10 AC 209 ms
79,536 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import array, bisect, collections, copy, heapq, itertools, math, random, re, string, sys, time
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7
 
 
def II(): return int(input())
def ILI(): return list(map(int, input().split()))
def IAI(LINE): return [ILI() for __ in range(LINE)]
def IDI(): return {key: value for key, value in ILI()}
 
 
def solve(N, A, B):
    my_mon = []
    for a in A:
        heapq.heappush(my_mon, [a, 0])
    ans = INF
    for i in range(N):
        my_mon_copy = copy.deepcopy(my_mon)
        ene_mon = B[i: N] + B[0: i]
        for ene in ene_mon:
            fig_mon = heapq.heappop(my_mon_copy)
            heapq.heappush(my_mon_copy, [fig_mon[0] + (ene // 2), fig_mon[1] + 1])
        l_fight = [mon[1] for mon in my_mon_copy]
        max_num = max(l_fight)
        ans = min(ans, max_num)

    return ans


def main():
    N = II()
    A = ILI()
    B = ILI()
    print(solve(N, A, B))
 
 
if __name__ == "__main__":
    main()
0