結果

問題 No.208 王将
ユーザー mobius_bkstmobius_bkst
提出日時 2015-05-15 22:35:23
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 973 bytes
コンパイル時間 3,717 ms
コンパイル使用メモリ 73,524 KB
実行使用メモリ 49,900 KB
最終ジャッジ日時 2023-09-20 08:21:13
合計ジャッジ時間 5,594 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,220 KB
testcase_01 AC 42 ms
49,412 KB
testcase_02 AC 46 ms
49,536 KB
testcase_03 AC 44 ms
49,276 KB
testcase_04 AC 48 ms
49,408 KB
testcase_05 AC 44 ms
49,536 KB
testcase_06 AC 43 ms
49,152 KB
testcase_07 AC 43 ms
49,300 KB
testcase_08 AC 42 ms
49,452 KB
testcase_09 AC 43 ms
49,500 KB
testcase_10 WA -
testcase_11 AC 43 ms
49,500 KB
testcase_12 AC 43 ms
49,168 KB
testcase_13 AC 43 ms
49,584 KB
testcase_14 WA -
testcase_15 AC 45 ms
49,416 KB
testcase_16 AC 44 ms
49,336 KB
testcase_17 AC 43 ms
47,456 KB
testcase_18 WA -
testcase_19 AC 42 ms
49,404 KB
testcase_20 AC 42 ms
47,924 KB
testcase_21 AC 48 ms
49,224 KB
testcase_22 AC 44 ms
49,224 KB
testcase_23 WA -
testcase_24 AC 44 ms
49,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No208 {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(
                    System.in));
            int[] a = strToIntArray(br.readLine());
            int x = a[0];
            int y = a[1];
            a = strToIntArray(br.readLine());
            int x2 = a[0];
            int y2 = a[1];
            int min = Math.min(x, y);
            int sub = Math.abs(x - y);

            System.out.println(min + sub);
        } catch (Exception e) {
            System.err.println("Error:" + e.getMessage());
        }
    }

    static int[] strToIntArray(String S) {
        String[] strArray = S.split(" ");
        int[] intArray = new int[strArray.length];
        for (int i = 0; i < strArray.length; i++) {
            intArray[i] = Integer.parseInt(strArray[i]);
        }
        return intArray;
    }
}
0