結果

問題 No.2239 Friday
ユーザー kanenistkanenist
提出日時 2023-04-11 12:26:12
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 375 bytes
コンパイル時間 2,438 ms
コンパイル使用メモリ 74,180 KB
実行使用メモリ 55,956 KB
最終ジャッジ日時 2024-04-16 11:12:12
合計ジャッジ時間 5,612 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
41,312 KB
testcase_01 AC 131 ms
48,276 KB
testcase_02 AC 131 ms
41,080 KB
testcase_03 AC 128 ms
41,552 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 129 ms
41,340 KB
testcase_07 AC 129 ms
41,404 KB
testcase_08 AC 131 ms
41,388 KB
testcase_09 AC 129 ms
41,356 KB
testcase_10 AC 131 ms
41,460 KB
testcase_11 AC 131 ms
41,404 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 136 ms
41,500 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 130 ms
41,060 KB
testcase_18 WA -
testcase_19 AC 130 ms
41,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
    	int min = Math.min(a,b);
    	int max = Math.max(a,b);
    	int h = max - min;
    	int ans = 2*min - h;
    	if(ans < 0) ans *= -1;
    	System.out.println(a == b?0:ans);
    }
}
0