結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
zer0
|
| 提出日時 | 2020-03-30 23:54:10 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 475 bytes |
| 記録 | |
| コンパイル時間 | 151 ms |
| コンパイル使用メモリ | 85,088 KB |
| 実行使用メモリ | 145,668 KB |
| 最終ジャッジ日時 | 2026-03-07 23:01:10 |
| 合計ジャッジ時間 | 45,051 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 WA * 11 TLE * 1 |
ソースコード
import heapq
import copy
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ahq = []
for i in a:
heapq.heappush(ahq, [i, 0])
ans = 10 ** 18
for i in range(N):
tans = 0
hq = copy.deepcopy(ahq)
for j in range(i, N + i):
l, c = heapq.heappop(hq)
heapq.heappush(hq, [l + (b[j % N] // 2), c + 1])
while hq:
l, c = heapq.heappop(hq)
tans = max(tans, c)
ans = min(ans, tans)
print(tans)
zer0