結果
| 問題 | 
                            No.965 門松列が嫌い
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-01-13 20:51:28 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 1,101 bytes | 
| コンパイル時間 | 1,694 ms | 
| コンパイル使用メモリ | 166,356 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-21 16:57:54 | 
| 合計ジャッジ時間 | 2,052 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 9 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define SZ(x) (int)(x.size())
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  ll a, b, c; cin >> a >> b >> c;
  ll ans = 0;
  if(max(a, max(b, c)) == b && min(a, min(b, c)) == c) {
    ans = min(b - a, a - c);
  } else if (max(a, max(b, c)) == c && min(a, min(b, c)) == b) {
    ans = min(c - a, a - b);
  } else if (max(a, max(b, c)) == b && min(a, min(b, c)) == a) {
    ans = min(b - c, c - a);
  } else if (max(a, max(b, c)) == a && min(a, min(b, c)) == b) {
    ans = min(a - c, c - b);
  }
  cout << ans << endl;
}