結果

問題 No.208 王将
コンテスト
ユーザー kou6839
提出日時 2015-05-18 12:47:06
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 52 ms / 1,000 ms
コード長 785 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,092 ms
コンパイル使用メモリ 85,212 KB
実行使用メモリ 41,856 KB
最終ジャッジ日時 2026-04-25 20:07:05
合計ジャッジ時間 4,395 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.io.*;
import java.util.*;
import java.awt.geom.Point2D;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {
    public static void main(String[] args){
        // TODO 自動生成されたメソッド・スタブ
        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){
        	System.out.println(Math.max(x, y));
        }else{
        	if( x1==y1 &&( (x1>0 && x>x1)|| (x1<0 && x1>x) )){
        		System.out.println(Math.max(x, y)+1);
        	}else{
        		System.out.println(Math.max(x, y));
        	}
        }
    }
}
0