結果

問題 No.965 門松列が嫌い
コンテスト
ユーザー leaf_1415
提出日時 2020-01-13 20:30:11
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 356µs
コード長 334 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 271 ms
コンパイル使用メモリ 73,032 KB
実行使用メモリ 9,840 KB
最終ジャッジ日時 2026-10-05 16:37:47
合計ジャッジ時間 1,251 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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