結果

問題 No.9 モンスターのレベル上げ
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-04-12 21:34:45
言語 PyPy3
(7.3.8)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 442 bytes
コンパイル時間 270 ms
使用メモリ 102,032 KB
最終ジャッジ日時 2023-01-28 12:53:34
合計ジャッジ時間 41,623 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 90 ms
75,700 KB
testcase_01 AC 92 ms
75,792 KB
testcase_02 AC 3,949 ms
101,184 KB
testcase_03 AC 3,110 ms
96,472 KB
testcase_04 AC 1,693 ms
87,904 KB
testcase_05 AC 1,162 ms
85,600 KB
testcase_06 AC 504 ms
83,476 KB
testcase_07 AC 148 ms
82,324 KB
testcase_08 AC 616 ms
83,892 KB
testcase_09 AC 3,873 ms
101,216 KB
testcase_10 AC 91 ms
75,464 KB
testcase_11 AC 3,444 ms
102,032 KB
testcase_12 TLE -
testcase_13 AC 3,863 ms
98,548 KB
testcase_14 AC 3,866 ms
101,324 KB
testcase_15 AC 3,567 ms
98,812 KB
testcase_16 AC 204 ms
82,816 KB
testcase_17 AC 2,301 ms
91,284 KB
testcase_18 AC 1,938 ms
89,612 KB
testcase_19 AC 183 ms
82,704 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