結果

問題 No.208 王将
ユーザー tenten
提出日時 2020-10-07 11:42:34
言語 Java
(openjdk 23)
結果
AC  
実行時間 142 ms / 1,000 ms
コード長 353 bytes
コンパイル時間 2,137 ms
コンパイル使用メモリ 74,084 KB
実行使用メモリ 41,628 KB
最終ジャッジ日時 2024-07-20 03:19:13
合計ジャッジ時間 6,548 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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