結果

問題 No.9 モンスターのレベル上げ
ユーザー ntudantuda
提出日時 2024-02-26 20:22:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 87,812 KB
最終ジャッジ日時 2024-02-26 20:22:42
合計ジャッジ時間 12,348 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 36 ms
53,460 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 33 ms
53,460 KB
testcase_11 AC 852 ms
83,072 KB
testcase_12 AC 830 ms
78,656 KB
testcase_13 AC 764 ms
82,716 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import *
N = int(input())
A = [(a,0) for i,a in enumerate(list(map(int,input().split())))]
B = list(map(int,input().split()))
ans = 0
for i in range(N):
    Q = A[:]
    heapify(Q)
    for j in range(N):
        a,k = heappop(Q)
        a += B[(i+j)%N] // 2
        heappush(Q,(a,k+1))
        ans = max(ans,k+1)
print(ans)

0