結果

問題 No.1883 SLASH
ユーザー BanetteGinBanetteGin
提出日時 2022-04-14 18:51:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 2,881 bytes
コンパイル時間 1,407 ms
コンパイル使用メモリ 170,012 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-25 22:42:20
合計ジャッジ時間 2,134 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for(int i = 0, n_f = (int)(n); i < n_f; ++i)
#define rrep(i, n) for(int i = 1, n_f = (int)(n); i <= n_f; ++i)
#define rrrep(i, a, n, p) for(int i = (int)(a), n_f = (int)(n), p_f = (int)(p); i <= n_f; i+=p_f)
#define repd(i, n) for(int i = (int)(n), n_f = 0; i >= n_f; --i)
#define all(a) (a).begin(),(a).end()
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define mpa(a,b) make_pair(a,b)
#define YES(a) if(a){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yes(a) if(a){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

typedef long long int ll;
typedef double dou;
typedef long double ld;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<string> vstr;
typedef vector<bool> vbol;
typedef vector<vector<bool>> vvbol;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<pair<int,int>> vpint;

const int dx[] = {-1,0,1,0};
const int dy[] = {0,1,0,-1};
const int mod99 = 998244353;
const int mod107 = 1000000007;
const ll mod99ll = 998244353LL;
const ll mod107ll = 1000000007LL;
const int INF = 1000000000;
const ll INFll = 1000000000000000000LL;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T>T permu(const T &n,const T &m) {T ret=1;for(T i=n;i>m;--i)ret*=i;return ret;}
template<class T>T conbi(const T &n,const T &m) {return permu(n,m)/permu(m,2);}
template<class T>T homog(const T &n,const T &m) {return conbi(n+m-1,m);}
template<class T>T mod_pow(T &a,T &n,const T &mod) {T ret=(T)1;while(n>0){if(n&(T)1)ret=ret*a%mod;a=a*a%mod;n>>=(T)1;}return ret;}
template<class T>T mod_inv(const T &a,const T &mod) {return modpow(a,mod-(T)2,mod);}
template<class T> T gcd(T n,T m){if(max(n,m)%min(n,m)==(T)0) return min(n,m);return gcd(min(n,m),(max(n,m)%min(n,m)));}
vector<pair<char,int>> run_length(string s){vector<pair<char,int>> r;for(int i=0;i<s.length();){int j = i+1;while (s[i]==s[j]&&j<s.length()){j++;}r.push_back({s[i],j-i});i=j;}return r;}
template<class T> vector<T> prime_sieve(T n){vector<bool> ret((n+1)/2,true);vector<T> prime_list = {2};ret[0] = false;T m = ((n+1)/2-2)/3;for(T a=1;a<=m;++a){for(T b=1;b<=a&&a+b+2*a*b<=(n+1)/2-1;++b){ret[a+b+2*a*b] = false;}}for(T i=0;i<ret.size();++i){if(ret[i]) prime_list.emplace_back(i*2+1);}return prime_list;}
template<class T> vector<T> prime_fac(T n){vector<T> lpf(n+1,n+1),prime_list,ret;lpf[0]=0;lpf[1]=1;for(T i=2;i<=n;++i){if(lpf[i]==n+1){prime_list.emplace_back(i);lpf[i] = i;}for(T j=0;j<prime_list.size();++j){T p=prime_list[j];if(p>lpf[i]||p*i>n) break;lpf[p*i] = p;}}while(n!=1){ret.emplace_back(lpf[n]);n/=lpf[n];}return ret;}

int main(void){
    string s;
    cin>>s;
    cout<<(int)(max({s[0],s[1],s[2]})-min({s[0],s[1],s[2]}))<<endl;
    return 0;
}
0