結果
| 問題 |
No.208 王将
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-11 10:31:35 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 526 bytes |
| コンパイル時間 | 3,835 ms |
| コンパイル使用メモリ | 74,912 KB |
| 実行使用メモリ | 56,376 KB |
| 最終ジャッジ日時 | 2024-11-17 09:21:14 |
| 合計ジャッジ時間 | 7,723 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 15 |
ソースコード
package yukicoder;
import java.util.Scanner;
public class N208 {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int hx = sc.nextInt();
int hy = sc.nextInt();
int ななめ = Math.min(Math.abs(x), Math.abs(y));
int step;
if(hx == hy && Math.abs(hx) <= ななめ){
step = 2;
}else if(Math.abs(hx) > ななめ || Math.abs(hy) > ななめ){
step = 1;
}else{
step = 0;
}
System.out.println(Math.max(x, y) + step);
}
}