結果

問題 No.208 王将
ユーザー YamaKasaYamaKasa
提出日時 2018-08-29 17:42:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 413 bytes
コンパイル時間 2,739 ms
コンパイル使用メモリ 70,692 KB
実行使用メモリ 57,884 KB
最終ジャッジ日時 2023-10-11 20:38:56
合計ジャッジ時間 7,392 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,412 KB
testcase_01 AC 123 ms
55,952 KB
testcase_02 AC 120 ms
55,456 KB
testcase_03 AC 123 ms
55,880 KB
testcase_04 AC 123 ms
55,444 KB
testcase_05 AC 126 ms
55,704 KB
testcase_06 AC 124 ms
55,832 KB
testcase_07 AC 122 ms
55,740 KB
testcase_08 AC 123 ms
55,420 KB
testcase_09 AC 122 ms
55,488 KB
testcase_10 AC 124 ms
55,472 KB
testcase_11 AC 122 ms
55,792 KB
testcase_12 AC 126 ms
57,884 KB
testcase_13 AC 125 ms
55,472 KB
testcase_14 AC 124 ms
55,928 KB
testcase_15 AC 123 ms
55,836 KB
testcase_16 AC 127 ms
53,872 KB
testcase_17 AC 123 ms
55,408 KB
testcase_18 AC 124 ms
56,000 KB
testcase_19 AC 124 ms
55,288 KB
testcase_20 AC 123 ms
55,888 KB
testcase_21 AC 123 ms
55,748 KB
testcase_22 AC 123 ms
55,740 KB
testcase_23 AC 123 ms
55,844 KB
testcase_24 AC 125 ms
55,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		int y = scan.nextInt();
		int x2 = scan.nextInt();
		int y2 = scan.nextInt();
		scan.close();
		if(x == y && x2 == y2 && x2 < x) {
			int ans = x + 1;
			System.out.println(ans);
		}else {
			int ans =  Math.max(x, y);
			System.out.println(ans);
		}
	}
}
0