結果

問題 No.126 2基のエレベータ
ユーザー kyuridenamidakyuridenamida
提出日時 2016-07-22 19:15:30
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 331 bytes
コンパイル時間 1,211 ms
コンパイル使用メモリ 157,780 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-24 02:04:23
合計ジャッジ時間 3,897 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 RE -
testcase_06 AC 1 ms
6,940 KB
testcase_07 RE -
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 2 ms
6,940 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 1 ms
6,944 KB
testcase_19 AC 1 ms
6,940 KB
testcase_20 RE -
testcase_21 AC 1 ms
6,940 KB
testcase_22 AC 1 ms
6,940 KB
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 1 ms
6,944 KB
testcase_25 AC 1 ms
6,944 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

typedef complex<double> P;
int main(){
	int A,B,S;
	cin >> A >> B >> S;
	int ans = 0;
	if( abs(A-S) > abs(B-S) ){
		ans += abs(B-S);
		if( A == 0 ){
			A += 1;
			ans += 1;
		}
		ans += abs(S-A) + abs(A);
		assert(0);		
	}else{

		ans += abs(A-S) + abs(S) ;
	}
	cout << ans << endl;
}
0