結果

問題 No.1883 SLASH
ユーザー superzugan
提出日時 2022-06-15 20:21:14
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 2,066 ms
コンパイル使用メモリ 192,820 KB
最終ジャッジ日時 2025-01-29 21:09:42
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;

int main(){
    int n;cin>>n;
    int s[3];
    rep(i,3){
        s[i]=n%10;
        n/=10;
    }
    int s_min=min({s[0],s[1],s[2]});
    int s_max=max({s[0],s[1],s[2]});
    //cout<<s[0]<<" "<<s[1]<<" "<<s[2]<<endl;
    cout<<s_max-s_min<<endl;
    return 0;
}
0