結果
| 問題 | No.126 2基のエレベータ |
| コンテスト | |
| ユーザー |
kongarishisyamo
|
| 提出日時 | 2016-05-23 15:56:34 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 279 bytes |
| 記録 | |
| コンパイル時間 | 496 ms |
| コンパイル使用メモリ | 60,740 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-07 01:20:41 |
| 合計ジャッジ時間 | 1,482 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 12 |
ソースコード
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
int A, B, S;
cin >> A >> B >> S;
if (abs(A - S) <= abs(B - S) || S == 1) cout << abs(A - S) + S << endl;
else cout << min(abs(A - B) + abs(A - S) + S, B - 1 + A - 1 + 1) << endl;
}
kongarishisyamo