結果

問題 No.126 2基のエレベータ
ユーザー GOTKAKO
提出日時 2025-07-12 18:46:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 1,797 ms
コンパイル使用メモリ 192,940 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-07-12 18:46:43
合計ジャッジ時間 2,962 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int a,b,s; cin >> a >> b >> s;
    if(abs(a-s) <= abs(b-s)) cout << abs(a-s)+s << endl;
    else if(a > 0) cout << abs(b-s)+abs(s-a)+a << endl;
    else cout << abs(b-s)+s-1+2 << endl;
}
0