結果

問題 No.9 モンスターのレベル上げ
ユーザー takakintakakin
提出日時 2020-04-30 23:15:29
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,454 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 886 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 83,296 KB
最終ジャッジ日時 2023-08-22 20:24:32
合計ジャッジ時間 15,812 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,676 KB
testcase_01 AC 92 ms
71,688 KB
testcase_02 AC 1,454 ms
82,732 KB
testcase_03 AC 1,138 ms
81,560 KB
testcase_04 AC 714 ms
79,756 KB
testcase_05 AC 547 ms
79,860 KB
testcase_06 AC 328 ms
79,508 KB
testcase_07 AC 167 ms
78,524 KB
testcase_08 AC 358 ms
80,292 KB
testcase_09 AC 1,371 ms
82,816 KB
testcase_10 AC 93 ms
71,640 KB
testcase_11 AC 1,137 ms
82,040 KB
testcase_12 AC 1,182 ms
81,988 KB
testcase_13 AC 1,038 ms
81,096 KB
testcase_14 AC 1,380 ms
82,504 KB
testcase_15 AC 1,264 ms
83,296 KB
testcase_16 AC 207 ms
79,000 KB
testcase_17 AC 919 ms
81,204 KB
testcase_18 AC 787 ms
80,524 KB
testcase_19 AC 184 ms
78,608 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