問題一覧 > 通常問題

No.1883 SLASH

レベル : / AI推定難易度 : 77 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 336
作問者 : miscalc / テスター : ygussany magsta
お気に入りにしたユーザー ProblemId : 4114 / 自分の提出
問題文最終更新日: 2022-02-04 20:17:23
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 337 (順位表) の他の問題:

Problem Statement

Distinct integers $a, b, c$, each between $0$ and $9$ inclusive, are given concatenated in this order.

Let $M$ be the largest and $m$ be the smallest of $a, b, c$. Find the value of $M - m$.

Input

$abc$

  • $a, b, c$ are distinct integers between $0$ and $9$ inclusive
  • There are no spaces between $a, b, c$

Output

Print the value of $M - m$. Add a newline at the end.

Sample

Sample 1
Input
168
Output
7

Since $M = 8, m = 1$, we have $M - m = 7$.

Sample 2
Input
053
Output
5

It is possible that $a = 0$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。