結果

問題 No.9 モンスターのレベル上げ
ユーザー KudeKude
提出日時 2020-09-03 08:01:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 503 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 86,788 KB
実行使用メモリ 122,700 KB
最終ジャッジ日時 2023-08-14 18:31:39
合計ジャッジ時間 33,039 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
71,208 KB
testcase_01 AC 59 ms
71,388 KB
testcase_02 AC 2,920 ms
122,700 KB
testcase_03 WA -
testcase_04 AC 1,257 ms
91,240 KB
testcase_05 WA -
testcase_06 AC 382 ms
80,132 KB
testcase_07 AC 112 ms
78,332 KB
testcase_08 AC 467 ms
80,924 KB
testcase_09 AC 2,888 ms
122,032 KB
testcase_10 AC 61 ms
71,240 KB
testcase_11 AC 3,596 ms
122,136 KB
testcase_12 AC 4,738 ms
120,204 KB
testcase_13 AC 2,847 ms
108,224 KB
testcase_14 AC 2,933 ms
122,388 KB
testcase_15 AC 2,624 ms
116,688 KB
testcase_16 AC 150 ms
78,080 KB
testcase_17 AC 1,743 ms
99,348 KB
testcase_18 AC 1,431 ms
94,152 KB
testcase_19 AC 139 ms
77,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappush, heappop
def solve():
    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, -1, 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)
solve()
0