結果
| 問題 | No.9 モンスターのレベル上げ |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 20:18:58 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,111 bytes |
| 記録 | |
| コンパイル時間 | 243 ms |
| コンパイル使用メモリ | 95,984 KB |
| 実行使用メモリ | 176,768 KB |
| 最終ジャッジ日時 | 2026-07-07 08:48:06 |
| 合計ジャッジ時間 | 19,679 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 1 TLE * 1 -- * 8 |
ソースコード
def main():
import sys
input = sys.stdin.read
data = input().split()
idx = 0
N = int(data[idx])
idx += 1
A = list(map(int, data[idx:idx+N]))
idx += N
B = list(map(int, data[idx:idx+N]))
min_max_usage = float('inf')
for start in range(N):
current_levels = A.copy()
usage = [0] * N
for j in range(N):
enemy_pos = (start + j) % N
enemy_level = B[enemy_pos]
# Find the monster with the minimum level and smallest index
min_level = current_levels[0]
min_idx = 0
for i in range(1, N):
if current_levels[i] < min_level:
min_level = current_levels[i]
min_idx = i
# Update usage and level
usage[min_idx] += 1
current_levels[min_idx] += enemy_level // 2
current_max = max(usage)
if current_max < min_max_usage:
min_max_usage = current_max
print(min_max_usage)
if __name__ == "__main__":
main()
lam6er