結果
問題 | No.208 王将 |
ユーザー |
![]() |
提出日時 | 2015-05-18 12:47:06 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 140 ms / 1,000 ms |
コード長 | 785 bytes |
コンパイル時間 | 2,694 ms |
コンパイル使用メモリ | 76,344 KB |
実行使用メモリ | 54,444 KB |
最終ジャッジ日時 | 2024-10-09 16:23:36 |
合計ジャッジ時間 | 6,771 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
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));}}}}