結果

問題 No.208 王将
ユーザー 37zigen37zigen
提出日時 2020-02-18 17:23:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 556 bytes
コンパイル時間 2,094 ms
コンパイル使用メモリ 75,004 KB
実行使用メモリ 41,748 KB
最終ジャッジ日時 2024-04-16 04:11:36
合計ジャッジ時間 6,404 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
40,308 KB
testcase_01 AC 130 ms
41,132 KB
testcase_02 AC 115 ms
39,920 KB
testcase_03 AC 128 ms
41,432 KB
testcase_04 AC 128 ms
41,472 KB
testcase_05 AC 131 ms
41,528 KB
testcase_06 AC 132 ms
41,640 KB
testcase_07 AC 118 ms
40,296 KB
testcase_08 AC 130 ms
41,276 KB
testcase_09 AC 129 ms
41,212 KB
testcase_10 AC 129 ms
41,300 KB
testcase_11 AC 132 ms
41,520 KB
testcase_12 AC 129 ms
41,408 KB
testcase_13 AC 131 ms
41,344 KB
testcase_14 AC 133 ms
41,188 KB
testcase_15 AC 132 ms
41,728 KB
testcase_16 AC 131 ms
41,396 KB
testcase_17 AC 132 ms
41,564 KB
testcase_18 AC 131 ms
41,684 KB
testcase_19 AC 136 ms
41,496 KB
testcase_20 AC 132 ms
41,748 KB
testcase_21 AC 131 ms
41,380 KB
testcase_22 AC 136 ms
41,360 KB
testcase_23 AC 115 ms
40,236 KB
testcase_24 AC 133 ms
41,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws Exception {
		new Main().run();
	}
	
	void run() {
		Scanner sc=new Scanner(System.in);
		long x=sc.nextLong();
		long y=sc.nextLong();
		long x1=sc.nextLong();
		long y1=sc.nextLong();
		long ans=Math.min(x, y)+Math.max(x, y)-Math.min(x, y);
		if(x==y&&x>x1&&y>y1&&x1==y1) {
			++ans;
		}
		System.out.println(ans);
	}
	
	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
	
}
0