結果

問題 No.1883 SLASH
ユーザー MatsuTakuMatsuTaku
提出日時 2022-03-25 21:21:42
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,385 bytes
コンパイル時間 3,267 ms
コンパイル使用メモリ 300,264 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-22 05:55:18
合計ジャッジ時間 3,432 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

/*
  Author : MatsuTaku
  Date   : 03/25/22
*/

#include <bits/stdc++.h>
#include <x86intrin.h>
//#include <atcoder/all>
#define _overload3(_1, _2, _3, target, ...) target
#define _REP(i, l, r)   for (int i = (l), i##_less = (r); i < i##_less; i++)
#define _rep(i, n)      _REP(i, 0, n)
#define rep(args...)    _overload3(args, _REP, _rep)(args)
#define _RREP(i, l, r)  for (int i = (r)-1, i##_least = (l); i >= i##_least; i--)
#define _rrep(i, n)     _RREP(i, 0, n)
#define rrep(args...)   _overload3(args, _RREP, _rrep)(args)
#define chmax(dst, x)   dst = max(dst, (x))
#define chmin(dst, x)   dst = min(dst, (x))
using namespace std;
using lint = long long int;
using ulint = unsigned long long int;
template<typename T>
using vvec = vector<vector<T>>;
template<typename T>
vvec<T> make_vvec(int n, int m, T v) { return vvec<T>(n, vector<T>(m, v)); }
template<typename T>
using min_queue = priority_queue<T, vector<T>, greater<T>>;

class Solver {
 public:
  Solver();
  void solve();
};

Solver::Solver() {}

void Solver::solve() {
  int x; cin>>x;
  int a = x%10;
  x /= 10;
  int b = x%10;
  x /= 10;
  int c = x;
  int M = max({a,b,c});
  int m = min({a,b,c});
  cout << M-m << endl;
}

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(10);
  Solver solver;
  int t = 1;
//  cin>>t;
  while (t--) {
    solver.solve();
  }
  return 0;
}
0