結果
| 問題 | No.126 2基のエレベータ |
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 14:19:33 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 430 bytes |
| 記録 | |
| コンパイル時間 | 232 ms |
| コンパイル使用メモリ | 95,596 KB |
| 実行使用メモリ | 78,764 KB |
| 最終ジャッジ日時 | 2026-07-11 11:30:08 |
| 合計ジャッジ時間 | 3,796 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 10 |
ソースコード
A, B, S = map(int, input().split())
# Compute scenario 1: using elevator A directly
scenario1 = abs(A - S) + S
# Compute scenario 2: using elevator B to an intermediate floor then A
option1 = abs(B - S) + abs(A - S) + S
if A >= 1:
option2 = abs(B - S) + abs(S - A) + A
scenario2 = min(option1, option2)
else:
scenario2 = option1
# Minimal total moves
minimal_total = min(scenario1, scenario2)
print(minimal_total)
gew1fw