結果

問題 No.208 王将
ユーザー shinwisteriashinwisteria
提出日時 2017-04-02 12:20:38
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 3,486 ms
コンパイル使用メモリ 73,004 KB
実行使用メモリ 57,892 KB
最終ジャッジ日時 2023-09-22 07:26:19
合計ジャッジ時間 8,851 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,652 KB
testcase_01 AC 127 ms
55,560 KB
testcase_02 AC 130 ms
55,528 KB
testcase_03 AC 127 ms
55,632 KB
testcase_04 AC 126 ms
55,804 KB
testcase_05 AC 126 ms
55,400 KB
testcase_06 WA -
testcase_07 AC 128 ms
55,688 KB
testcase_08 AC 129 ms
55,660 KB
testcase_09 AC 129 ms
55,784 KB
testcase_10 AC 127 ms
57,804 KB
testcase_11 AC 128 ms
55,632 KB
testcase_12 AC 127 ms
55,704 KB
testcase_13 AC 126 ms
55,856 KB
testcase_14 AC 128 ms
55,644 KB
testcase_15 AC 126 ms
55,920 KB
testcase_16 AC 127 ms
55,704 KB
testcase_17 AC 124 ms
55,732 KB
testcase_18 AC 126 ms
55,608 KB
testcase_19 AC 125 ms
55,824 KB
testcase_20 AC 127 ms
55,552 KB
testcase_21 AC 129 ms
55,712 KB
testcase_22 AC 129 ms
55,612 KB
testcase_23 AC 128 ms
55,780 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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){
				count = x+1;
			}else{
				count = x;
			}
		}else{
			count = Math.min(x, y) + Math.abs(x-y);
		}
		System.out.println(count);
	}

}
0