結果

問題 No.965 門松列が嫌い
ユーザー Y_S
提出日時 2020-07-15 05:57:13
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 340 bytes
コンパイル時間 743 ms
コンパイル使用メモリ 74,896 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-20 20:03:35
合計ジャッジ時間 1,322 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main() {

	vector<int> A(3);
	for (int i = 0; i < 3; i++) {
		cin >> A[i];
	}

	sort(A.begin(), A.end());

	int a = A[2] - A[1];
	int b = A[1] - A[0];

	if (a < b) {
		cout << a << endl;
	}
	else {
		cout << b << endl;
	}

	return 0;

}
0