結果
| 問題 |
No.9 モンスターのレベル上げ
|
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 15:17:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 882 bytes |
| コンパイル時間 | 169 ms |
| コンパイル使用メモリ | 82,376 KB |
| 実行使用メモリ | 53,660 KB |
| 最終ジャッジ日時 | 2025-06-12 15:17:32 |
| 合計ジャッジ時間 | 6,872 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 TLE * 1 -- * 17 |
ソースコード
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
min_max = float('inf')
for k in range(n):
enemy_order = [B[(k + i) % n] for i in range(n)]
a = A.copy()
fight_counts = [0] * n
for b in enemy_order:
min_level = min(a)
candidates = [i for i in range(n) if a[i] == min_level]
possible = [i for i in candidates if fight_counts[i] == 0]
if possible:
chosen = min(possible)
else:
min_fight = min(fight_counts[i] for i in candidates)
possible = [i for i in candidates if fight_counts[i] == min_fight]
chosen = min(possible)
exp = b // 2
a[chosen] += exp
fight_counts[chosen] += 1
current_max = max(fight_counts)
if current_max < min_max:
min_max = current_max
print(min_max)
gew1fw