結果

問題 No.965 門松列が嫌い
ユーザー uwiuwi
提出日時 2020-01-13 19:29:04
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,124 bytes
コンパイル時間 3,324 ms
コンパイル使用メモリ 74,476 KB
実行使用メモリ 55,596 KB
最終ジャッジ日時 2023-08-23 11:53:35
合計ジャッジ時間 5,332 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
39,600 KB
testcase_01 AC 108 ms
39,164 KB
testcase_02 AC 120 ms
39,420 KB
testcase_03 AC 112 ms
38,992 KB
testcase_04 AC 108 ms
38,952 KB
testcase_05 AC 107 ms
39,156 KB
testcase_06 AC 92 ms
37,708 KB
testcase_07 AC 107 ms
39,176 KB
testcase_08 AC 109 ms
39,108 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

package contest200113;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

// 片手落ちマン
public class B2 {
	static Scanner in;
	static PrintWriter out;
	static String INPUT = "";
	
	static void solve()
	{
		int A = ni(), B = ni(), C = ni();
		if(!(1 <= A && A <= 1000000000))throw new RuntimeException();
		if(!(1 <= B && B <= 1000000000))throw new RuntimeException();
		if(!(1 <= C && C <= 1000000000))throw new RuntimeException();
		if(!(B < A && A < C || C < A && A < B || B < C && C < A || A < C && C < B)) {
			throw new RuntimeException();
		}
		out.println(Math.min(Math.abs(A-B), Math.abs(A-C)));
	}
	
	public static void main(String[] args) throws Exception
	{
		in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
		out = new PrintWriter(System.out);
		
		solve();
		out.flush();
	}
	
	static int ni() { return Integer.parseInt(in.next()); }
	static long nl() { return Long.parseLong(in.next()); }
	static double nd() { return Double.parseDouble(in.next()); }
	static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); }
}
0