結果
| 問題 |
No.9 モンスターのレベル上げ
|
| ユーザー |
|
| 提出日時 | 2023-09-28 02:56:36 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 526 bytes |
| コンパイル時間 | 235 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 107,548 KB |
| 最終ジャッジ日時 | 2024-07-20 21:36:04 |
| 合計ジャッジ時間 | 33,973 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 WA * 12 |
ソースコード
from heapq import heapify, heappop, heappush
import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
H = []
for i in range(n):
H.append((A[i], 0, i))
heapify(H)
ans = 10**18
for i in range(n):
Hc = H[:]
C = [0 for _ in range(n)]
for j in range(n):
ii = (i + j) % n
cl, cc, ci = heappop(H)
cc += 1
C[ci] = cc
cl += B[ii] // 2
heappush(H, (cl, cc, ci))
ans = min(ans, max(C))
print(ans)