結果

問題 No.9 モンスターのレベル上げ
ユーザー pluto77pluto77
提出日時 2016-09-23 08:40:42
言語 PyPy2
(7.3.8)
結果
AC  
実行時間 1,007 ms / 5,000 ms
コード長 308 bytes
コンパイル時間 156 ms
使用メモリ 91,764 KB
最終ジャッジ日時 2023-01-21 16:07:36
合計ジャッジ時間 11,588 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 84 ms
83,660 KB
testcase_01 AC 83 ms
83,908 KB
testcase_02 AC 963 ms
91,436 KB
testcase_03 AC 821 ms
90,580 KB
testcase_04 AC 515 ms
88,164 KB
testcase_05 AC 407 ms
87,732 KB
testcase_06 AC 229 ms
86,904 KB
testcase_07 AC 122 ms
85,892 KB
testcase_08 AC 270 ms
86,872 KB
testcase_09 AC 1,007 ms
91,764 KB
testcase_10 AC 82 ms
83,400 KB
testcase_11 AC 790 ms
91,476 KB
testcase_12 AC 785 ms
88,664 KB
testcase_13 AC 691 ms
90,728 KB
testcase_14 AC 955 ms
91,428 KB
testcase_15 AC 904 ms
90,852 KB
testcase_16 AC 148 ms
85,992 KB
testcase_17 AC 629 ms
88,624 KB
testcase_18 AC 568 ms
88,712 KB
testcase_19 AC 139 ms
85,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_9
import heapq

n=int(raw_input())
a=[(int(i),0) for i in raw_input().split()]
b=map(int,raw_input().split())
heapq.heapify(a)

res=n
for i in xrange(n):
 aa=a[:]
 for j in range(i,i+n):
  r=j%n
  x,y=aa[0]
  heapq.heapreplace(aa,(x+b[r]/2,y+1))
 temp=max(z for x,z in aa)
 res=min(res,temp)
print res
0