結果

問題 No.9 モンスターのレベル上げ
ユーザー ryusukeryusuke
提出日時 2022-02-05 17:05:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 512 bytes
コンパイル時間 1,334 ms
コンパイル使用メモリ 86,880 KB
実行使用メモリ 112,556 KB
最終ジャッジ日時 2023-09-02 06:47:16
合計ジャッジ時間 26,146 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 247 ms
94,948 KB
testcase_01 AC 243 ms
94,908 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 267 ms
94,992 KB
testcase_11 AC 1,898 ms
110,492 KB
testcase_12 AC 1,740 ms
112,168 KB
testcase_13 AC 1,532 ms
107,804 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
from tkinter import W

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