結果

問題 No.9 モンスターのレベル上げ
ユーザー tktk_snsntktk_snsn
提出日時 2021-01-02 05:48:15
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 1,351 ms / 5,000 ms
コード長 376 bytes
コンパイル時間 246 ms
使用メモリ 101,784 KB
最終ジャッジ日時 2022-12-04 16:54:19
合計ジャッジ時間 14,795 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 75 ms
75,552 KB
testcase_01 AC 73 ms
75,620 KB
testcase_02 AC 1,275 ms
100,636 KB
testcase_03 AC 1,071 ms
97,204 KB
testcase_04 AC 690 ms
88,044 KB
testcase_05 AC 530 ms
87,844 KB
testcase_06 AC 308 ms
83,904 KB
testcase_07 AC 145 ms
82,488 KB
testcase_08 AC 326 ms
84,400 KB
testcase_09 AC 1,243 ms
100,332 KB
testcase_10 AC 73 ms
75,564 KB
testcase_11 AC 936 ms
93,628 KB
testcase_12 AC 845 ms
91,724 KB
testcase_13 AC 883 ms
92,092 KB
testcase_14 AC 1,351 ms
101,784 KB
testcase_15 AC 1,210 ms
99,020 KB
testcase_16 AC 176 ms
82,944 KB
testcase_17 AC 808 ms
92,240 KB
testcase_18 AC 727 ms
89,952 KB
testcase_19 AC 157 ms
82,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split())) * 2

ans = N
for i in range(N):
    P = [(a, 0) for a in A]
    heapq.heapify(P)
    for j in range(N):
        a, c = heapq.heappop(P)
        a += B[i+j]//2
        c += 1
        heapq.heappush(P, (a, c))
    tmp = max(c for _, c in P)
    ans = min(ans, tmp)

print(ans)
0