結果

問題 No.208 王将
ユーザー bambambambam
提出日時 2019-08-27 10:55:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 404 bytes
コンパイル時間 2,374 ms
コンパイル使用メモリ 74,140 KB
実行使用メモリ 54,240 KB
最終ジャッジ日時 2024-04-26 15:37:49
合計ジャッジ時間 6,051 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
53,528 KB
testcase_01 AC 122 ms
53,856 KB
testcase_02 AC 122 ms
54,016 KB
testcase_03 AC 121 ms
53,928 KB
testcase_04 AC 124 ms
54,060 KB
testcase_05 AC 111 ms
52,736 KB
testcase_06 AC 110 ms
53,008 KB
testcase_07 AC 122 ms
53,944 KB
testcase_08 AC 125 ms
53,920 KB
testcase_09 AC 110 ms
52,980 KB
testcase_10 AC 125 ms
53,796 KB
testcase_11 AC 114 ms
53,652 KB
testcase_12 AC 127 ms
54,000 KB
testcase_13 AC 126 ms
53,928 KB
testcase_14 AC 123 ms
54,012 KB
testcase_15 AC 127 ms
53,864 KB
testcase_16 AC 127 ms
53,872 KB
testcase_17 AC 125 ms
53,948 KB
testcase_18 AC 115 ms
52,712 KB
testcase_19 AC 116 ms
52,976 KB
testcase_20 AC 127 ms
53,892 KB
testcase_21 AC 123 ms
54,240 KB
testcase_22 AC 125 ms
54,036 KB
testcase_23 AC 123 ms
53,964 KB
testcase_24 AC 123 ms
53,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int x = sc.nextInt();
		int y = sc.nextInt();
		int x1 = sc.nextInt();
		int y1 = sc.nextInt();
		int ans;
		if (x == y && x1 == y1 && x > x1) {
			ans = x + 1;
		} else {
			ans = Math.max(x, y);
		}
		System.out.println(ans);
	}
}
0