結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,024 KB
testcase_01 AC 119 ms
55,664 KB
testcase_02 AC 120 ms
55,824 KB
testcase_03 AC 121 ms
55,740 KB
testcase_04 AC 128 ms
55,668 KB
testcase_05 AC 125 ms
55,848 KB
testcase_06 AC 126 ms
55,708 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 128 ms
55,800 KB
testcase_10 WA -
testcase_11 AC 117 ms
55,648 KB
testcase_12 AC 118 ms
55,668 KB
testcase_13 AC 120 ms
55,716 KB
testcase_14 WA -
testcase_15 AC 120 ms
55,788 KB
testcase_16 AC 120 ms
55,904 KB
testcase_17 AC 122 ms
55,792 KB
testcase_18 WA -
testcase_19 AC 120 ms
55,720 KB
testcase_20 AC 122 ms
55,732 KB
testcase_21 AC 139 ms
55,496 KB
testcase_22 AC 122 ms
55,496 KB
testcase_23 WA -
testcase_24 AC 118 ms
55,740 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 + 2);
		}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