結果
| 問題 | No.1883 SLASH | 
| コンテスト | |
| ユーザー |  koryou | 
| 提出日時 | 2022-03-25 21:22:03 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 1,763 bytes | 
| コンパイル時間 | 887 ms | 
| コンパイル使用メモリ | 101,368 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-10-14 05:09:37 | 
| 合計ジャッジ時間 | 1,495 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 13 | 
ソースコード
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <string>
#include <list>
#include <cassert>
#include <numeric>
#include <cstdint>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <random>
// #include <atcoder/all>
 
using ll = long long;
using ld = long double;
using namespace std;
// using namespace atcoder;
using P = pair<ll, ll>;
using Graph = vector<vector<int>>;
using Priority = priority_queue<ll, vector<ll>, greater<ll>>;// 昇順
using Priority_pair = priority_queue<P, vector<P>, greater<P>>;
// using mint_17 = modint1000000007;
// using mint = modint998244353;
#define mod 1000000007
#define MAX_WIDTH 60
#define MAX_HEIGHT 60
#define INF 1e18
#define MOD 998244353
#define PI 3.141592653589793
#define rep(i, s, n) for (ll i=(s);i<(n);i++)
#define rrep(i, s, n) for (ll i=(n);i>=(s);i--)
#define all(v) (v).begin(), (v).end()
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define pb(n) push_back(n)
#define vi vector<int>
#define vll vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vp vector<pair<ll, ll>>
#define mll map<ll, ll>
#define msl map<string, ll>
#define COUT(n) cout << (n) << endl
#define isInGrid(n, h, w) (0 <= (n) && (n) < (h) && 0 <= (n) && (n) < (w))
template<typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
string S;
int main() {
    cin >> S;
    ll mx = -INF, mn = INF;
    rep(i, 0, 3) {
        mn = min(mn, ll(S[i]-'0'));
        mx = max(mx, ll(S[i]-'0'));
    }
    COUT(mx-mn);
    return 0;
}
            
            
            
        