結果

問題 No.9 モンスターのレベル上げ
ユーザー takakintakakin
提出日時 2020-04-30 23:15:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,903 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-05-10 02:03:18
合計ジャッジ時間 28,881 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,880 KB
testcase_01 AC 30 ms
10,880 KB
testcase_02 AC 2,894 ms
11,136 KB
testcase_03 AC 2,251 ms
10,880 KB
testcase_04 AC 1,251 ms
11,008 KB
testcase_05 AC 822 ms
11,008 KB
testcase_06 AC 327 ms
11,008 KB
testcase_07 AC 35 ms
10,752 KB
testcase_08 AC 415 ms
10,880 KB
testcase_09 AC 2,765 ms
11,136 KB
testcase_10 AC 28 ms
10,752 KB
testcase_11 AC 2,692 ms
11,008 KB
testcase_12 AC 2,903 ms
11,008 KB
testcase_13 AC 2,593 ms
10,880 KB
testcase_14 AC 2,800 ms
11,136 KB
testcase_15 AC 2,594 ms
11,008 KB
testcase_16 AC 76 ms
10,880 KB
testcase_17 AC 1,633 ms
10,880 KB
testcase_18 AC 1,411 ms
10,880 KB
testcase_19 AC 56 ms
10,752 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