結果

問題 No.208 王将
ユーザー uafr_csuafr_cs
提出日時 2015-05-15 22:35:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 637 bytes
コンパイル時間 2,033 ms
コンパイル使用メモリ 72,048 KB
実行使用メモリ 56,168 KB
最終ジャッジ日時 2023-09-20 08:21:21
合計ジャッジ時間 6,381 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
55,896 KB
testcase_01 AC 127 ms
55,692 KB
testcase_02 AC 127 ms
55,612 KB
testcase_03 AC 129 ms
55,904 KB
testcase_04 AC 125 ms
55,668 KB
testcase_05 AC 126 ms
55,828 KB
testcase_06 AC 132 ms
55,700 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 127 ms
55,664 KB
testcase_10 WA -
testcase_11 AC 129 ms
55,888 KB
testcase_12 AC 127 ms
55,492 KB
testcase_13 AC 127 ms
55,816 KB
testcase_14 WA -
testcase_15 AC 130 ms
56,168 KB
testcase_16 AC 128 ms
55,760 KB
testcase_17 AC 130 ms
56,040 KB
testcase_18 WA -
testcase_19 AC 130 ms
55,792 KB
testcase_20 AC 131 ms
56,060 KB
testcase_21 AC 128 ms
55,964 KB
testcase_22 AC 129 ms
55,676 KB
testcase_23 WA -
testcase_24 AC 129 ms
55,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		final long x = sc.nextLong();
		final long y = sc.nextLong();
		final long x2 = sc.nextLong();
		final long y2 = sc.nextLong();
		
		final long opt = x + y - Math.min(x, y);
		
		if(x == y && x2 == y2 && x2 < x && y2 < y){
			System.out.println(opt + 3);
		}else if(x == 0 && x2 == 0 && y2 < y){
			System.out.println(opt + 2);
		}else if(y == 0 && y2 == 0 && x2 < x){
			System.out.println(opt + 2);
		}else {
			System.out.println(opt);
		}
	}
	
}
0