結果

問題 No.965 門松列が嫌い
ユーザー ks2mks2m
提出日時 2020-01-13 20:38:22
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 600 bytes
コンパイル時間 3,050 ms
コンパイル使用メモリ 71,540 KB
実行使用メモリ 51,440 KB
最終ジャッジ日時 2023-08-23 13:08:49
合計ジャッジ時間 3,162 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,028 KB
testcase_01 AC 43 ms
49,368 KB
testcase_02 AC 44 ms
49,804 KB
testcase_03 AC 44 ms
49,476 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 44 ms
49,368 KB
testcase_08 WA -
testcase_09 AC 44 ms
49,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int a = Integer.parseInt(sa[0]);
		int b = Integer.parseInt(sa[1]);
		int c = Integer.parseInt(sa[2]);
		br.close();

		if (a <= b && b <= c || c <= b && b <= a) {
			System.out.println(0);
			return;
		}
		if (a <= b) {
			System.out.println(Math.min(b - a, b - c));
		} else {
			System.out.println(Math.min(a - b, c - b));
		}
	}
}
0