結果

問題 No.208 王将
ユーザー mobius_bkstmobius_bkst
提出日時 2015-05-16 09:43:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 56 ms / 1,000 ms
コード長 1,039 bytes
コンパイル時間 3,223 ms
コンパイル使用メモリ 76,092 KB
実行使用メモリ 37,232 KB
最終ジャッジ日時 2024-04-17 22:39:45
合計ジャッジ時間 5,274 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
36,672 KB
testcase_01 AC 50 ms
37,172 KB
testcase_02 AC 55 ms
36,896 KB
testcase_03 AC 54 ms
37,164 KB
testcase_04 AC 51 ms
36,888 KB
testcase_05 AC 46 ms
37,076 KB
testcase_06 AC 51 ms
37,096 KB
testcase_07 AC 50 ms
36,844 KB
testcase_08 AC 52 ms
36,840 KB
testcase_09 AC 51 ms
36,936 KB
testcase_10 AC 48 ms
36,912 KB
testcase_11 AC 48 ms
36,880 KB
testcase_12 AC 50 ms
37,028 KB
testcase_13 AC 48 ms
36,648 KB
testcase_14 AC 50 ms
37,012 KB
testcase_15 AC 49 ms
36,988 KB
testcase_16 AC 48 ms
37,064 KB
testcase_17 AC 49 ms
37,208 KB
testcase_18 AC 51 ms
37,048 KB
testcase_19 AC 52 ms
36,872 KB
testcase_20 AC 50 ms
37,196 KB
testcase_21 AC 55 ms
37,232 KB
testcase_22 AC 53 ms
36,768 KB
testcase_23 AC 56 ms
37,088 KB
testcase_24 AC 54 ms
36,788 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());
            long x = a[0];
            long y = a[1];
            a = strToIntArray(br.readLine());
            long x2 = a[0];
            long y2 = a[1];

            long ans = Math.max(x, y);
            if (x - x2 > 0 && y - y2 > 0 && x == y && x2 == y2) {
                ans += 1;
            }
            System.out.println(ans);
        } 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