結果

問題 No.9 モンスターのレベル上げ
ユーザー takakintakakin
提出日時 2020-04-30 23:15:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,257 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 82,344 KB
実行使用メモリ 81,032 KB
最終ジャッジ日時 2024-05-10 02:03:48
合計ジャッジ時間 14,265 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,504 KB
testcase_01 AC 43 ms
53,376 KB
testcase_02 AC 1,257 ms
81,032 KB
testcase_03 AC 1,018 ms
80,680 KB
testcase_04 AC 635 ms
78,284 KB
testcase_05 AC 479 ms
78,168 KB
testcase_06 AC 271 ms
78,008 KB
testcase_07 AC 120 ms
77,344 KB
testcase_08 AC 294 ms
77,772 KB
testcase_09 AC 1,225 ms
80,656 KB
testcase_10 AC 43 ms
54,144 KB
testcase_11 AC 977 ms
80,436 KB
testcase_12 AC 1,023 ms
80,380 KB
testcase_13 AC 896 ms
79,788 KB
testcase_14 AC 1,175 ms
80,984 KB
testcase_15 AC 1,116 ms
80,912 KB
testcase_16 AC 155 ms
77,632 KB
testcase_17 AC 792 ms
79,744 KB
testcase_18 AC 667 ms
78,740 KB
testcase_19 AC 138 ms
77,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
A=[int(i)*(10**4) for i in input().split()]
B=[int(i)//2 for i in input().split()]
import heapq
import copy
ans=n
for i in range(n):
  Q=copy.deepcopy(A)
  heapq.heapify(Q)
  for j in range(n):
    ind=i+j
    if ind>=n:
      ind%=n
    heapq.heappush(Q,heapq.heappop(Q)+B[ind]*(10**4)+1)

  ans=min(ans,max(q%10**4 for q in Q))
print(ans)
0