結果

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

ソースコード

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 cout << abs(b-s)+s-1+abs(a-1)+1 << endl;
}
0