結果
問題 | No.126 2基のエレベータ |
ユーザー |
![]() |
提出日時 | 2015-01-13 23:41:07 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 353 bytes |
コンパイル時間 | 688 ms |
コンパイル使用メモリ | 59,680 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 05:32:35 |
合計ジャッジ時間 | 1,694 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 WA * 8 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>using namespace std;int a, b, s;int main() {cin >> a >> b >> s;int move = 0;if (s == 1) {move += abs(a - s) + 1;} else if (abs(a - s) <= abs(b - s)) {move += abs(a - s) + s;} else {move += abs(b - s) + abs(a - s);move += a;}cout << move << endl;return 0;}