結果

問題 No.126 2基のエレベータ
ユーザー Onju
提出日時 2015-02-04 01:22:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 267 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 57,996 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 07:19:55
合計ジャッジ時間 1,309 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	int A, B, S, AS, BS;
	cin >> A >> B >> S;
	AS = abs(A - S);
	BS = abs(B - S);

	if (A == 0)
		cout << BS + S + 1;
	else if (AS <= BS)
		cout << AS + S;
	else
		cout << BS + AS + A;

	return 0;
}
0