結果
| 問題 |
No.9 モンスターのレベル上げ
|
| ユーザー |
takakin
|
| 提出日時 | 2020-04-30 23:15:29 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,358 ms / 5,000 ms |
| コード長 | 411 bytes |
| コンパイル時間 | 499 ms |
| コンパイル使用メモリ | 82,160 KB |
| 実行使用メモリ | 81,136 KB |
| 最終ジャッジ日時 | 2024-12-17 22:00:10 |
| 合計ジャッジ時間 | 14,768 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
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)
takakin