結果

問題 No.208 王将
ユーザー bambambambam
提出日時 2019-08-27 10:55:06
言語 Java19
(openjdk 21)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 404 bytes
コンパイル時間 2,044 ms
コンパイル使用メモリ 71,592 KB
実行使用メモリ 56,104 KB
最終ジャッジ日時 2023-08-08 23:29:44
合計ジャッジ時間 6,832 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,516 KB
testcase_01 AC 127 ms
55,860 KB
testcase_02 AC 127 ms
55,948 KB
testcase_03 AC 126 ms
55,372 KB
testcase_04 AC 125 ms
55,704 KB
testcase_05 AC 125 ms
55,652 KB
testcase_06 AC 125 ms
55,856 KB
testcase_07 AC 126 ms
55,868 KB
testcase_08 AC 126 ms
55,728 KB
testcase_09 AC 125 ms
55,664 KB
testcase_10 AC 125 ms
55,880 KB
testcase_11 AC 127 ms
55,668 KB
testcase_12 AC 127 ms
55,760 KB
testcase_13 AC 128 ms
55,892 KB
testcase_14 AC 124 ms
55,436 KB
testcase_15 AC 124 ms
55,868 KB
testcase_16 AC 123 ms
55,920 KB
testcase_17 AC 125 ms
55,676 KB
testcase_18 AC 126 ms
55,636 KB
testcase_19 AC 124 ms
55,756 KB
testcase_20 AC 124 ms
55,876 KB
testcase_21 AC 130 ms
55,608 KB
testcase_22 AC 125 ms
56,104 KB
testcase_23 AC 125 ms
55,760 KB
testcase_24 AC 126 ms
55,832 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