結果
| 問題 | No.208 王将 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-02 12:22:10 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 1,000 ms |
| コード長 | 410 bytes |
| 記録 | |
| コンパイル時間 | 2,680 ms |
| コンパイル使用メモリ | 82,044 KB |
| 実行使用メモリ | 41,840 KB |
| 最終ジャッジ日時 | 2026-03-29 15:28:18 |
| 合計ジャッジ時間 | 4,852 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
import java.util.Scanner;
public class Ousho {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int x = s.nextInt(),y = s.nextInt(),x2 = s.nextInt(),y2 = s.nextInt();
s.close();
int count = 0;
if(x == y){
if(x2 == y2 && x > x2){
count = x+1;
}else{
count = x;
}
}else{
count = Math.min(x, y) + Math.abs(x-y);
}
System.out.println(count);
}
}