結果
| 問題 | No.208 王将 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-08-13 00:46:53 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 1,000 ms |
| コード長 | 564 bytes |
| 記録 | |
| コンパイル時間 | 2,892 ms |
| コンパイル使用メモリ | 82,212 KB |
| 実行使用メモリ | 41,728 KB |
| 最終ジャッジ日時 | 2026-04-25 20:09:42 |
| 合計ジャッジ時間 | 5,936 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
import java.util.*;
public class Osho{
public static void main(String... args){
Scanner scan = new Scanner(System.in);
int x=scan.nextInt(),y=scan.nextInt(),x1=scan.nextInt(),y1=scan.nextInt();
int res = Math.max(x,y);
if(Math.abs(x) == Math.abs(y) && Math.abs(x1) == Math.abs(y1) && Math.abs(x) > Math.abs(x1)){
if(x>0 && y>0 && x1>0 && y1>0){
res++;
}else if(x>0 && y<0 && x1>0 && y1<0){
res++;
}else if(x<0 && y>0 && x1<0 && y1>0){
res++;
}else if(x<0 && y<0 && x1<0 && y1<0){
res++;
}
}
System.out.println(res);
}
}