結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,640 KB
testcase_01 AC 121 ms
55,304 KB
testcase_02 AC 120 ms
55,684 KB
testcase_03 WA -
testcase_04 AC 120 ms
55,764 KB
testcase_05 AC 119 ms
55,628 KB
testcase_06 AC 122 ms
55,648 KB
testcase_07 AC 120 ms
53,780 KB
testcase_08 AC 122 ms
55,740 KB
testcase_09 AC 121 ms
56,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

// 片手落ちマン3
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-C), Math.abs(B-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