結果

問題 No.9 モンスターのレベル上げ
ユーザー kohei2019kohei2019
提出日時 2021-02-03 08:58:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 466 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 91,880 KB
最終ジャッジ日時 2023-09-12 11:45:36
合計ジャッジ時間 20,801 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,312 KB
testcase_01 AC 78 ms
71,176 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 78 ms
71,344 KB
testcase_11 AC 1,684 ms
90,388 KB
testcase_12 AC 1,656 ms
90,380 KB
testcase_13 AC 1,225 ms
87,592 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N = int(input())
lsA = list(map(int,input().split()))
lsB = list(map(int,input().split()))
#N**2logN
ans = float('INF')
for st in range(N):
    h = [(i,0) for i in lsA]
    heapq.heapify(h)
    for i in range(N):
        lv,times = heapq.heappop(h)
        lv += lsB[(st+i)%2]//2
        heapq.heappush(h,(lv,times+1))
    cnt = 0
    for i in range(N):
        lv,times = heapq.heappop(h)
        cnt = max(cnt,times)
    ans = min(cnt,ans)
print(ans)
0