結果

問題 No.208 王将
ユーザー YamaKasa
提出日時 2018-08-29 17:42:59
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 1,000 ms
コード長 413 bytes
コンパイル時間 2,324 ms
コンパイル使用メモリ 74,304 KB
実行使用メモリ 54,304 KB
最終ジャッジ日時 2024-09-13 19:29:51
合計ジャッジ時間 6,645 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

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