結果

問題 No.965 門松列が嫌い
ユーザー leaf_1415
提出日時 2020-01-13 20:30:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 334 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 57,220 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-21 16:17:25
合計ジャッジ時間 926 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#define llint long long

using namespace std;

llint a, b, c;

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> a >> b >> c;
	
	if(a < b){
		cout << min(abs(a-c), b-max(a, c)) << endl;
	}
	else{
		cout << min(abs(a-c), min(a, c)-b) << endl;
	}
	
	return 0;
}
0