結果

問題 No.9 モンスターのレベル上げ
ユーザー ryusukeryusuke
提出日時 2022-02-05 17:06:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 490 bytes
コンパイル時間 509 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 91,704 KB
最終ジャッジ日時 2023-09-02 06:47:41
合計ジャッジ時間 22,850 ms
ジャッジサーバーID
(参考情報)
judge16 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,272 KB
testcase_01 AC 78 ms
71,560 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 76 ms
71,240 KB
testcase_11 AC 1,870 ms
89,444 KB
testcase_12 AC 1,808 ms
91,596 KB
testcase_13 AC 1,458 ms
86,772 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heapify, heappop, heappush

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = []
for start in range(n):
    q = []
    heapify(q)
    for i in range(n):
        heappush(q, (a[i], 0))
    
    for i in range(n):
        p, num = heappop(q)
        p += b[(start + i) % n] // 2
        heappush(q, (p, num + 1))
    
    ma = 0
    for i in range(n):
        ma = max(ma, heappop(q)[1])
    
    ans.append(ma)

print(max(ans))
0