結果

問題 No.9 モンスターのレベル上げ
ユーザー KudeKude
提出日時 2020-09-03 07:52:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 2,447 ms
コンパイル使用メモリ 86,536 KB
実行使用メモリ 124,860 KB
最終ジャッジ日時 2023-08-14 18:21:01
合計ジャッジ時間 28,343 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
70,816 KB
testcase_01 AC 59 ms
70,808 KB
testcase_02 AC 3,019 ms
124,744 KB
testcase_03 WA -
testcase_04 AC 1,304 ms
91,548 KB
testcase_05 WA -
testcase_06 AC 395 ms
79,920 KB
testcase_07 AC 120 ms
78,152 KB
testcase_08 AC 495 ms
80,760 KB
testcase_09 AC 3,016 ms
123,776 KB
testcase_10 AC 64 ms
70,968 KB
testcase_11 AC 3,684 ms
122,424 KB
testcase_12 TLE -
testcase_13 AC 3,104 ms
109,308 KB
testcase_14 AC 3,055 ms
124,860 KB
testcase_15 AC 2,734 ms
119,144 KB
testcase_16 AC 160 ms
78,532 KB
testcase_17 AC 1,838 ms
100,612 KB
testcase_18 AC 1,528 ms
95,228 KB
testcase_19 AC 153 ms
78,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappush, heappop
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
b = b + b
ans = n
for s in range(n):
    q = []
    cnt = [0] * n
    for i, ai in enumerate(a):
        heappush(q, (ai, 0, i))
    for j in range(s, s + n):
        ai, _, i = heappop(q)
        cnt[i] += 1
        heappush(q, (ai + b[j] // 2, j, i))
    ans = min(ans, max(cnt))
print(ans)
0