結果

問題 No.9 モンスターのレベル上げ
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-04-12 21:34:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 4,239 ms / 5,000 ms
コード長 442 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 97,400 KB
最終ジャッジ日時 2023-09-11 02:43:39
合計ジャッジ時間 33,112 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,204 KB
testcase_01 AC 75 ms
71,092 KB
testcase_02 AC 3,067 ms
96,624 KB
testcase_03 AC 2,436 ms
91,396 KB
testcase_04 AC 1,322 ms
84,092 KB
testcase_05 AC 927 ms
80,816 KB
testcase_06 AC 411 ms
78,552 KB
testcase_07 AC 130 ms
77,584 KB
testcase_08 AC 496 ms
79,364 KB
testcase_09 AC 3,015 ms
96,196 KB
testcase_10 AC 75 ms
71,260 KB
testcase_11 AC 2,681 ms
97,400 KB
testcase_12 AC 4,239 ms
82,328 KB
testcase_13 AC 3,175 ms
94,476 KB
testcase_14 AC 3,052 ms
96,844 KB
testcase_15 AC 2,714 ms
94,272 KB
testcase_16 AC 169 ms
77,728 KB
testcase_17 AC 1,814 ms
87,024 KB
testcase_18 AC 1,505 ms
85,544 KB
testcase_19 AC 153 ms
77,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappush, heappop

n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

ans = 10**10
base = []
for ind,a in enumerate(A):
    heappush(base, (a,0,ind))
for i in range(n):
    count = [0]*n
    h = base.copy()
    for j in range(n):
        a,num,ind = heappop(h)
        count[ind] += 1
        a += B[(i+j)%n]//2
        heappush(h, (a,num+1,ind))
    ans = min(ans,max(count))
print(ans)
0