結果

問題 No.208 王将
ユーザー atkrymatkrym
提出日時 2016-10-23 18:18:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 637 bytes
コンパイル時間 1,910 ms
コンパイル使用メモリ 73,964 KB
実行使用メモリ 41,656 KB
最終ジャッジ日時 2024-05-03 04:52:20
合計ジャッジ時間 6,000 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
41,380 KB
testcase_01 AC 115 ms
41,416 KB
testcase_02 AC 117 ms
41,272 KB
testcase_03 AC 115 ms
41,092 KB
testcase_04 AC 113 ms
41,292 KB
testcase_05 AC 112 ms
41,512 KB
testcase_06 AC 118 ms
41,344 KB
testcase_07 AC 118 ms
41,156 KB
testcase_08 AC 116 ms
39,880 KB
testcase_09 AC 106 ms
41,176 KB
testcase_10 AC 108 ms
41,640 KB
testcase_11 AC 119 ms
41,540 KB
testcase_12 AC 112 ms
41,512 KB
testcase_13 AC 108 ms
41,324 KB
testcase_14 AC 114 ms
41,164 KB
testcase_15 AC 120 ms
40,068 KB
testcase_16 AC 125 ms
41,304 KB
testcase_17 AC 120 ms
40,216 KB
testcase_18 AC 119 ms
41,580 KB
testcase_19 AC 114 ms
41,656 KB
testcase_20 AC 105 ms
41,020 KB
testcase_21 AC 118 ms
41,460 KB
testcase_22 AC 124 ms
41,344 KB
testcase_23 AC 119 ms
41,512 KB
testcase_24 AC 118 ms
41,128 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