結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
41,140 KB
testcase_01 AC 129 ms
41,240 KB
testcase_02 AC 128 ms
41,096 KB
testcase_03 AC 129 ms
41,308 KB
testcase_04 AC 115 ms
41,076 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 129 ms
41,156 KB
testcase_08 AC 130 ms
41,240 KB
testcase_09 AC 131 ms
40,896 KB
testcase_10 AC 131 ms
41,220 KB
testcase_11 AC 132 ms
41,088 KB
testcase_12 WA -
testcase_13 AC 130 ms
41,112 KB
testcase_14 AC 129 ms
41,176 KB
testcase_15 AC 131 ms
41,076 KB
testcase_16 AC 131 ms
41,176 KB
testcase_17 AC 130 ms
41,292 KB
testcase_18 AC 130 ms
41,388 KB
testcase_19 AC 130 ms
41,688 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 = a<c?Math.max(0,b-c+1):Math.max(0,d-a+1);
		System.out.println(aka*kuro-dab);
	}
}
0