結果

問題 No.9 モンスターのレベル上げ
ユーザー ntudantuda
提出日時 2024-02-26 20:27:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,177 ms / 5,000 ms
コード長 374 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 85,384 KB
最終ジャッジ日時 2024-02-26 20:28:04
合計ジャッジ時間 12,476 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 1,177 ms
85,384 KB
testcase_03 AC 913 ms
82,936 KB
testcase_04 AC 575 ms
79,004 KB
testcase_05 AC 426 ms
78,024 KB
testcase_06 AC 226 ms
77,296 KB
testcase_07 AC 94 ms
76,128 KB
testcase_08 AC 260 ms
77,092 KB
testcase_09 AC 1,148 ms
84,720 KB
testcase_10 AC 34 ms
53,460 KB
testcase_11 AC 832 ms
83,204 KB
testcase_12 AC 792 ms
78,660 KB
testcase_13 AC 771 ms
82,836 KB
testcase_14 AC 1,168 ms
84,716 KB
testcase_15 AC 1,072 ms
84,724 KB
testcase_16 AC 119 ms
76,528 KB
testcase_17 AC 736 ms
80,356 KB
testcase_18 AC 613 ms
79,280 KB
testcase_19 AC 114 ms
76,168 KB
権限があれば一括ダウンロードができます

ソースコード

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 = 2000
for i in range(N):
    tmp = 0
    Q = A[:]
    heapify(Q)
    for j in range(N):
        a,k = heappop(Q)
        a += B[(i+j)%N] // 2
        heappush(Q,(a,k+1))
        tmp = max(tmp,k+1)
    ans = min(ans,tmp)
print(ans)

0