結果
| 問題 |
No.9 モンスターのレベル上げ
|
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 22:12:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 922 bytes |
| コンパイル時間 | 231 ms |
| コンパイル使用メモリ | 81,556 KB |
| 実行使用メモリ | 52,528 KB |
| 最終ジャッジ日時 | 2025-04-15 22:13:50 |
| 合計ジャッジ時間 | 7,509 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 TLE * 1 -- * 17 |
ソースコード
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
min_result = float('inf')
for start in range(n):
current_A = A.copy()
used = [False] * n
count = [0] * n
for i in range(n):
enemy_idx = (start + i) % n
enemy_level = B[enemy_idx]
min_level = min(current_A)
candidates = []
available = []
for j in range(n):
if current_A[j] == min_level:
candidates.append(j)
if not used[j]:
available.append(j)
if available:
chosen = min(available)
else:
chosen = min(candidates)
count[chosen] += 1
current_A[chosen] += enemy_level // 2
used[chosen] = True
current_max = max(count)
if current_max < min_result:
min_result = current_max
print(min_result)
lam6er