結果

問題 No.799 赤黒かーどげぇむ
ユーザー Beat7501Beat7501
提出日時 2019-03-28 17:30:38
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 483 bytes
コンパイル時間 2,290 ms
コンパイル使用メモリ 74,056 KB
実行使用メモリ 54,220 KB
最終ジャッジ日時 2024-04-21 08:38:25
合計ジャッジ時間 5,684 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
54,024 KB
testcase_01 AC 125 ms
53,968 KB
testcase_02 AC 128 ms
53,792 KB
testcase_03 AC 128 ms
53,904 KB
testcase_04 AC 128 ms
53,500 KB
testcase_05 AC 129 ms
54,016 KB
testcase_06 WA -
testcase_07 AC 130 ms
54,144 KB
testcase_08 AC 128 ms
54,096 KB
testcase_09 AC 128 ms
53,948 KB
testcase_10 AC 128 ms
53,904 KB
testcase_11 AC 128 ms
53,988 KB
testcase_12 WA -
testcase_13 AC 133 ms
53,880 KB
testcase_14 AC 129 ms
54,112 KB
testcase_15 AC 130 ms
53,852 KB
testcase_16 AC 131 ms
54,084 KB
testcase_17 AC 132 ms
53,980 KB
testcase_18 AC 129 ms
54,004 KB
testcase_19 AC 129 ms
53,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Yuki799{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int aka = b-a+1;
		int kuro = d-c+1;
		int dab = 0;
		if((a < c && d < b)||(d < a && b < c)){
			if(a < c && d < b){
				dab = d-c+1;
			}else{
				dab = b-a+1;
			}
		}else{
			dab = a<c?Math.max(0,b-c+1):Math.max(0,d-a+1);
		}
		System.out.println(aka*kuro-dab);
	}
}
0