結果

問題 No.9 モンスターのレベル上げ
ユーザー kohei2019kohei2019
提出日時 2021-02-03 09:00:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,105 ms / 5,000 ms
コード長 466 bytes
コンパイル時間 390 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 92,828 KB
最終ジャッジ日時 2023-09-12 11:45:59
合計ジャッジ時間 21,743 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,036 KB
testcase_01 AC 77 ms
71,256 KB
testcase_02 AC 2,105 ms
92,828 KB
testcase_03 AC 1,768 ms
89,704 KB
testcase_04 AC 1,076 ms
82,860 KB
testcase_05 AC 760 ms
80,720 KB
testcase_06 AC 426 ms
79,348 KB
testcase_07 AC 154 ms
77,844 KB
testcase_08 AC 474 ms
80,288 KB
testcase_09 AC 2,015 ms
91,976 KB
testcase_10 AC 76 ms
71,176 KB
testcase_11 AC 1,700 ms
90,288 KB
testcase_12 AC 1,646 ms
90,792 KB
testcase_13 AC 1,319 ms
87,932 KB
testcase_14 AC 2,054 ms
92,656 KB
testcase_15 AC 1,897 ms
91,888 KB
testcase_16 AC 208 ms
78,236 KB
testcase_17 AC 1,254 ms
85,348 KB
testcase_18 AC 1,081 ms
83,508 KB
testcase_19 AC 176 ms
77,960 KB
権限があれば一括ダウンロードができます

ソースコード

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)%N]//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