結果

問題 No.208 王将
ユーザー uafr_csuafr_cs
提出日時 2015-05-15 22:41:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 1,000 ms
コード長 490 bytes
コンパイル時間 2,231 ms
コンパイル使用メモリ 74,224 KB
実行使用メモリ 41,644 KB
最終ジャッジ日時 2024-04-17 22:48:11
合計ジャッジ時間 5,832 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
41,324 KB
testcase_01 AC 113 ms
41,412 KB
testcase_02 AC 128 ms
41,548 KB
testcase_03 AC 122 ms
41,568 KB
testcase_04 AC 108 ms
41,520 KB
testcase_05 AC 120 ms
41,464 KB
testcase_06 AC 125 ms
41,552 KB
testcase_07 AC 127 ms
41,276 KB
testcase_08 AC 126 ms
41,644 KB
testcase_09 AC 128 ms
41,436 KB
testcase_10 AC 127 ms
41,516 KB
testcase_11 AC 128 ms
41,420 KB
testcase_12 AC 125 ms
41,452 KB
testcase_13 AC 125 ms
41,448 KB
testcase_14 AC 128 ms
41,436 KB
testcase_15 AC 128 ms
41,172 KB
testcase_16 AC 130 ms
41,224 KB
testcase_17 AC 129 ms
41,388 KB
testcase_18 AC 131 ms
41,160 KB
testcase_19 AC 129 ms
41,472 KB
testcase_20 AC 130 ms
41,288 KB
testcase_21 AC 130 ms
41,340 KB
testcase_22 AC 126 ms
41,348 KB
testcase_23 AC 131 ms
41,212 KB
testcase_24 AC 129 ms
41,524 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{
			System.out.println(opt);
		}
	}
	
}
0