結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
56,064 KB
testcase_01 AC 129 ms
55,700 KB
testcase_02 AC 128 ms
55,656 KB
testcase_03 AC 128 ms
55,648 KB
testcase_04 AC 129 ms
55,780 KB
testcase_05 AC 128 ms
55,812 KB
testcase_06 AC 128 ms
55,584 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 126 ms
55,904 KB
testcase_10 AC 126 ms
55,876 KB
testcase_11 AC 128 ms
55,648 KB
testcase_12 AC 127 ms
55,896 KB
testcase_13 AC 128 ms
55,732 KB
testcase_14 AC 126 ms
55,424 KB
testcase_15 AC 126 ms
55,948 KB
testcase_16 AC 125 ms
56,272 KB
testcase_17 AC 126 ms
55,488 KB
testcase_18 AC 128 ms
55,920 KB
testcase_19 AC 127 ms
55,440 KB
testcase_20 AC 131 ms
55,624 KB
testcase_21 AC 126 ms
55,780 KB
testcase_22 AC 126 ms
55,484 KB
testcase_23 AC 126 ms
55,432 KB
testcase_24 AC 124 ms
56,280 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 + 1);
		}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