結果

問題 No.965 門松列が嫌い
コンテスト
ユーザー toof
提出日時 2020-01-13 21:39:24
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 783µs
コード長 613 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,232 ms
コンパイル使用メモリ 217,460 KB
実行使用メモリ 9,900 KB
最終ジャッジ日時 2026-10-25 05:02:17
合計ジャッジ時間 2,808 ms
ジャッジサーバーID
(参考情報)
judge6_0 / judge7_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }
template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; }

int main() {
  cin.tie(0); ios::sync_with_stdio(false);

  constexpr ll n = 3;
  vl a(n);
  rep(i, n) {
    cin >> a[i];
  }

  sort(all(a));
  cout << min(a[2]-a[1], a[1]-a[0]) << endl;
}
0