結果

問題 No.208 王将
ユーザー atkrymatkrym
提出日時 2016-10-23 18:18:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 1,000 ms
コード長 637 bytes
コンパイル時間 2,748 ms
コンパイル使用メモリ 71,416 KB
実行使用メモリ 56,412 KB
最終ジャッジ日時 2023-08-15 18:01:47
合計ジャッジ時間 7,234 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,604 KB
testcase_01 AC 124 ms
55,680 KB
testcase_02 AC 121 ms
55,832 KB
testcase_03 AC 122 ms
55,696 KB
testcase_04 AC 122 ms
55,944 KB
testcase_05 AC 122 ms
55,932 KB
testcase_06 AC 123 ms
55,992 KB
testcase_07 AC 123 ms
55,304 KB
testcase_08 AC 122 ms
55,616 KB
testcase_09 AC 122 ms
55,616 KB
testcase_10 AC 123 ms
55,820 KB
testcase_11 AC 122 ms
55,580 KB
testcase_12 AC 120 ms
55,616 KB
testcase_13 AC 121 ms
55,868 KB
testcase_14 AC 123 ms
56,412 KB
testcase_15 AC 123 ms
55,440 KB
testcase_16 AC 122 ms
55,676 KB
testcase_17 AC 126 ms
55,784 KB
testcase_18 AC 125 ms
55,936 KB
testcase_19 AC 121 ms
55,696 KB
testcase_20 AC 120 ms
55,620 KB
testcase_21 AC 122 ms
55,832 KB
testcase_22 AC 120 ms
54,048 KB
testcase_23 AC 121 ms
55,668 KB
testcase_24 AC 125 ms
55,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;
import java.text.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int x = sc.nextInt();
        int y = sc.nextInt();
        int x1 = sc.nextInt();
        int y1 = sc.nextInt();
        
        if (x > y) {
            System.out.println(x);
        } else if (y > x) {
            System.out.println(y);
        } else {
            if (x1 == y1 && x1 < x) {
                System.out.println(x+1);
            } else {
                System.out.println(x);
            }
        }
    }
}
0