結果

問題 No.965 門松列が嫌い
ユーザー kanra824kanra824
提出日時 2020-01-13 20:51:28
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,101 bytes
コンパイル時間 1,581 ms
コンパイル使用メモリ 165,752 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-23 13:32:17
合計ジャッジ時間 2,215 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;

}
0