結果

問題 No.799 赤黒かーどげぇむ
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2019-03-17 21:50:31
言語 Java17
(openjdk 17.0.1)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 1,967 ms
使用メモリ 38,736 KB
最終ジャッジ日時 2023-02-11 06:01:06
合計ジャッジ時間 5,006 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 94 ms
37,312 KB
testcase_01 AC 94 ms
38,516 KB
testcase_02 AC 94 ms
37,460 KB
testcase_03 AC 94 ms
38,600 KB
testcase_04 AC 94 ms
38,344 KB
testcase_05 AC 94 ms
38,480 KB
testcase_06 AC 97 ms
37,456 KB
testcase_07 AC 93 ms
37,504 KB
testcase_08 AC 96 ms
38,568 KB
testcase_09 AC 96 ms
38,376 KB
testcase_10 AC 95 ms
38,428 KB
testcase_11 AC 93 ms
37,296 KB
testcase_12 AC 96 ms
37,548 KB
testcase_13 AC 94 ms
37,368 KB
testcase_14 AC 95 ms
38,408 KB
testcase_15 AC 97 ms
38,736 KB
testcase_16 AC 95 ms
37,368 KB
testcase_17 AC 94 ms
37,348 KB
testcase_18 AC 98 ms
37,436 KB
testcase_19 AC 97 ms
37,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    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 ans = 0;
        for(int i = a; i <= b; i++) {
            for(int j = c; j <= d; j++) {
                if(i != j) {
                    ans++;
                }
            }
        }
        System.out.println(ans);
    }
}
0