結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
41,432 KB
testcase_01 AC 151 ms
41,160 KB
testcase_02 AC 155 ms
40,996 KB
testcase_03 AC 155 ms
41,108 KB
testcase_04 AC 152 ms
41,020 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 150 ms
41,036 KB
testcase_08 AC 154 ms
41,432 KB
testcase_09 AC 149 ms
40,872 KB
testcase_10 AC 148 ms
41,084 KB
testcase_11 AC 151 ms
41,144 KB
testcase_12 WA -
testcase_13 AC 152 ms
41,128 KB
testcase_14 AC 156 ms
41,272 KB
testcase_15 AC 155 ms
41,340 KB
testcase_16 AC 160 ms
41,012 KB
testcase_17 AC 158 ms
41,112 KB
testcase_18 AC 148 ms
41,100 KB
testcase_19 AC 148 ms
41,128 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