結果

問題 No.9 モンスターのレベル上げ
ユーザー takakintakakin
提出日時 2020-04-30 23:15:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,968 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 8,812 KB
最終ジャッジ日時 2023-08-22 20:23:38
合計ジャッジ時間 29,595 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,504 KB
testcase_01 AC 18 ms
8,452 KB
testcase_02 AC 2,968 ms
8,660 KB
testcase_03 AC 2,274 ms
8,668 KB
testcase_04 AC 1,250 ms
8,640 KB
testcase_05 AC 825 ms
8,616 KB
testcase_06 AC 307 ms
8,588 KB
testcase_07 AC 24 ms
8,536 KB
testcase_08 AC 402 ms
8,536 KB
testcase_09 AC 2,830 ms
8,684 KB
testcase_10 AC 18 ms
8,552 KB
testcase_11 AC 2,664 ms
8,812 KB
testcase_12 AC 2,913 ms
8,592 KB
testcase_13 AC 2,636 ms
8,600 KB
testcase_14 AC 2,856 ms
8,612 KB
testcase_15 AC 2,632 ms
8,804 KB
testcase_16 AC 68 ms
8,512 KB
testcase_17 AC 1,675 ms
8,636 KB
testcase_18 AC 1,408 ms
8,752 KB
testcase_19 AC 47 ms
8,644 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