結果

問題 No.9 モンスターのレベル上げ
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-04-12 21:30:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 572 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 98,336 KB
最終ジャッジ日時 2023-09-11 02:38:38
合計ジャッジ時間 15,870 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,068 KB
testcase_01 AC 77 ms
71,472 KB
testcase_02 AC 1,427 ms
98,336 KB
testcase_03 WA -
testcase_04 AC 682 ms
84,084 KB
testcase_05 AC 498 ms
81,384 KB
testcase_06 AC 293 ms
79,416 KB
testcase_07 AC 135 ms
78,324 KB
testcase_08 AC 338 ms
79,756 KB
testcase_09 AC 1,411 ms
97,844 KB
testcase_10 AC 77 ms
71,368 KB
testcase_11 AC 1,145 ms
92,272 KB
testcase_12 AC 1,186 ms
93,384 KB
testcase_13 WA -
testcase_14 AC 1,376 ms
97,476 KB
testcase_15 AC 1,257 ms
94,512 KB
testcase_16 AC 171 ms
78,336 KB
testcase_17 WA -
testcase_18 AC 722 ms
85,940 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappush, heappop

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

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