結果

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

テストケース

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

ソースコード

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);
		
	}else{
		assert(0);
		ans += abs(A-S) + abs(S) ;
	}
	cout << ans << endl;
}
0