結果

問題 No.208 王将
ユーザー mobius_bkstmobius_bkst
提出日時 2015-05-16 09:37:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,011 bytes
コンパイル時間 3,343 ms
コンパイル使用メモリ 83,356 KB
実行使用メモリ 49,776 KB
最終ジャッジ日時 2023-09-20 09:06:19
合計ジャッジ時間 5,387 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,268 KB
testcase_01 AC 42 ms
49,212 KB
testcase_02 AC 43 ms
49,252 KB
testcase_03 AC 44 ms
49,404 KB
testcase_04 AC 42 ms
49,336 KB
testcase_05 AC 44 ms
49,172 KB
testcase_06 WA -
testcase_07 AC 43 ms
49,700 KB
testcase_08 AC 43 ms
49,776 KB
testcase_09 AC 43 ms
49,680 KB
testcase_10 AC 43 ms
49,360 KB
testcase_11 AC 42 ms
49,428 KB
testcase_12 AC 43 ms
49,568 KB
testcase_13 AC 41 ms
49,332 KB
testcase_14 AC 42 ms
49,388 KB
testcase_15 AC 41 ms
49,176 KB
testcase_16 AC 44 ms
49,680 KB
testcase_17 AC 43 ms
49,744 KB
testcase_18 AC 42 ms
49,236 KB
testcase_19 AC 43 ms
47,156 KB
testcase_20 AC 43 ms
49,232 KB
testcase_21 AC 43 ms
49,316 KB
testcase_22 AC 42 ms
49,524 KB
testcase_23 AC 42 ms
49,288 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

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 == 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