結果

問題 No.9 モンスターのレベル上げ
ユーザー miztommiztom
提出日時 2024-03-12 15:44:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 818 ms / 5,000 ms
コード長 274 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 78,508 KB
最終ジャッジ日時 2024-03-12 15:44:46
合計ジャッジ時間 9,688 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,332 KB
testcase_01 AC 34 ms
53,332 KB
testcase_02 AC 818 ms
78,508 KB
testcase_03 AC 640 ms
77,756 KB
testcase_04 AC 374 ms
76,524 KB
testcase_05 AC 273 ms
76,556 KB
testcase_06 AC 174 ms
76,292 KB
testcase_07 AC 87 ms
76,368 KB
testcase_08 AC 176 ms
76,268 KB
testcase_09 AC 782 ms
78,276 KB
testcase_10 AC 35 ms
53,332 KB
testcase_11 AC 637 ms
78,388 KB
testcase_12 AC 589 ms
78,336 KB
testcase_13 AC 557 ms
77,524 KB
testcase_14 AC 771 ms
78,232 KB
testcase_15 AC 735 ms
78,028 KB
testcase_16 AC 124 ms
76,300 KB
testcase_17 AC 492 ms
77,420 KB
testcase_18 AC 448 ms
76,976 KB
testcase_19 AC 99 ms
76,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import*
n=int(input())
a=[int(i)<<11 for i in input().split()]
heapify(a)
b=[*map(int,input().split())]
m=2**11-1
r=1<<11
for i in range(n):
    h=a.copy()
    for j in range(-i,n-i):heappush(h,heappop(h)+(b[j]>>1<<11)+1)
    r=min(r,max(j&m for j in h))
print(r)
0