結果

問題 No.126 2基のエレベータ
ユーザー fiord
提出日時 2015-04-26 16:27:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 219 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 58,464 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-05 02:49:38
合計ジャッジ時間 1,344 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;
int main(){
	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) a=2;
		cout<<abs(b-s)+s-1+a<<endl;
	}
	return 0;
}
0