結果

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    vector<int> vc;
    for (int i = 0; i < 3; i++) {
        int n;
        cin >> n;
        vc.push_back(n);
    }
    sort(vc.begin(), vc.end());
    int ab = max(vc.at(0) - vc.at(1), vc.at(1) - vc.at(0));
    int bc = max(vc.at(1) - vc.at(2), vc.at(2) - vc.at(1));
    cout << min(ab, bc) << "\n";
    return 0;
}
0