結果

問題 No.9 モンスターのレベル上げ
ユーザー kohei2019kohei2019
提出日時 2021-02-03 09:00:30
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 2,019 ms / 5,000 ms
コード長 466 bytes
コンパイル時間 258 ms
使用メモリ 98,100 KB
最終ジャッジ日時 2023-01-30 08:25:24
合計ジャッジ時間 21,384 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 81 ms
75,660 KB
testcase_01 AC 83 ms
75,840 KB
testcase_02 AC 2,019 ms
97,108 KB
testcase_03 AC 1,724 ms
94,044 KB
testcase_04 AC 1,010 ms
87,984 KB
testcase_05 AC 749 ms
85,952 KB
testcase_06 AC 431 ms
84,076 KB
testcase_07 AC 168 ms
82,240 KB
testcase_08 AC 488 ms
84,148 KB
testcase_09 AC 1,966 ms
96,980 KB
testcase_10 AC 81 ms
75,832 KB
testcase_11 AC 1,605 ms
95,196 KB
testcase_12 AC 1,538 ms
94,508 KB
testcase_13 AC 1,219 ms
92,424 KB
testcase_14 AC 1,968 ms
98,100 KB
testcase_15 AC 1,881 ms
95,416 KB
testcase_16 AC 226 ms
82,644 KB
testcase_17 AC 1,276 ms
89,948 KB
testcase_18 AC 1,122 ms
88,500 KB
testcase_19 AC 196 ms
83,036 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