結果

問題 No.208 王将
ユーザー shinwisteriashinwisteria
提出日時 2017-04-02 12:22:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 410 bytes
コンパイル時間 3,513 ms
コンパイル使用メモリ 72,988 KB
実行使用メモリ 56,244 KB
最終ジャッジ日時 2023-09-22 07:27:59
合計ジャッジ時間 7,814 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,840 KB
testcase_01 AC 119 ms
55,864 KB
testcase_02 AC 119 ms
55,960 KB
testcase_03 AC 118 ms
55,760 KB
testcase_04 AC 118 ms
55,584 KB
testcase_05 AC 120 ms
55,712 KB
testcase_06 AC 123 ms
56,024 KB
testcase_07 AC 118 ms
55,832 KB
testcase_08 AC 118 ms
55,912 KB
testcase_09 AC 125 ms
55,984 KB
testcase_10 AC 121 ms
55,536 KB
testcase_11 AC 127 ms
55,776 KB
testcase_12 AC 118 ms
55,936 KB
testcase_13 AC 122 ms
55,804 KB
testcase_14 AC 121 ms
55,796 KB
testcase_15 AC 136 ms
55,844 KB
testcase_16 AC 120 ms
56,244 KB
testcase_17 AC 119 ms
55,920 KB
testcase_18 AC 119 ms
56,140 KB
testcase_19 AC 120 ms
55,960 KB
testcase_20 AC 119 ms
55,912 KB
testcase_21 AC 121 ms
55,868 KB
testcase_22 AC 117 ms
55,576 KB
testcase_23 AC 119 ms
55,780 KB
testcase_24 AC 123 ms
55,940 KB
権限があれば一括ダウンロードができます

ソースコード

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

}
0