結果
| 問題 |
No.208 王将
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-08-13 00:46:53 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 132 ms / 1,000 ms |
| コード長 | 564 bytes |
| コンパイル時間 | 3,448 ms |
| コンパイル使用メモリ | 74,772 KB |
| 実行使用メモリ | 41,492 KB |
| 最終ジャッジ日時 | 2024-10-09 16:26:50 |
| 合計ジャッジ時間 | 7,565 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
}
}