結果

問題 No.9 モンスターのレベル上げ
ユーザー lloyzlloyz
提出日時 2023-09-28 02:56:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 526 bytes
コンパイル時間 951 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 109,872 KB
最終ジャッジ日時 2023-09-28 02:57:09
合計ジャッジ時間 32,922 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,420 KB
testcase_01 AC 69 ms
71,364 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 69 ms
71,528 KB
testcase_11 AC 2,633 ms
106,008 KB
testcase_12 AC 4,054 ms
82,560 KB
testcase_13 AC 3,198 ms
101,568 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 1,828 ms
93,692 KB
testcase_18 AC 1,429 ms
89,560 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heapify, heappop, heappush
import sys
input = sys.stdin.readline

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

H = []
for i in range(n):
    H.append((A[i], 0, i))
heapify(H)
ans = 10**18
for i in range(n):
    Hc = H[:]
    C = [0 for _ in range(n)]
    for j in range(n):
        ii = (i + j) % n
        cl, cc, ci = heappop(H)
        cc += 1
        C[ci] = cc
        cl += B[ii] // 2
        heappush(H, (cl, cc, ci))
    ans = min(ans, max(C))
print(ans)
0