結果

問題 No.9 モンスターのレベル上げ
ユーザー dangodango
提出日時 2023-07-08 08:56:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,164 ms / 5,000 ms
コード長 396 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 79,752 KB
最終ジャッジ日時 2023-09-29 10:13:12
合計ジャッジ時間 12,839 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,540 KB
testcase_01 AC 75 ms
71,116 KB
testcase_02 AC 1,164 ms
79,344 KB
testcase_03 AC 895 ms
78,836 KB
testcase_04 AC 473 ms
77,596 KB
testcase_05 AC 337 ms
77,436 KB
testcase_06 AC 174 ms
76,836 KB
testcase_07 AC 91 ms
76,416 KB
testcase_08 AC 199 ms
76,976 KB
testcase_09 AC 1,113 ms
79,472 KB
testcase_10 AC 75 ms
71,420 KB
testcase_11 AC 916 ms
79,752 KB
testcase_12 AC 1,007 ms
78,908 KB
testcase_13 AC 1,062 ms
79,484 KB
testcase_14 AC 1,118 ms
79,616 KB
testcase_15 AC 1,008 ms
79,256 KB
testcase_16 AC 104 ms
76,920 KB
testcase_17 AC 653 ms
78,804 KB
testcase_18 AC 541 ms
77,876 KB
testcase_19 AC 101 ms
76,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
n = int(input())
a = sorted(map(lambda i: int(i) * 2000, input().split())) + [10 ** 9]
b = list(map(lambda i: int(i) // 2, input().split()))
def f(i):
    pq = a[:]
    for e in b[i:] + b[:i]:
        l = pq.pop(0)
        up = l + e * 2000 + 1
        pq.insert(bisect_left(pq, up), up)
    return max(x % 2000 for x in pq[:-1])
print(min(f(i) for i in range(n)))
0