結果

問題 No.799 赤黒かーどげぇむ
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2019-03-17 21:50:31
言語 Java19
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 2,240 ms
コンパイル使用メモリ 71,876 KB
実行使用メモリ 56,228 KB
最終ジャッジ日時 2023-09-22 05:04:49
合計ジャッジ時間 5,887 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,764 KB
testcase_01 AC 119 ms
55,932 KB
testcase_02 AC 119 ms
55,688 KB
testcase_03 AC 119 ms
55,948 KB
testcase_04 AC 119 ms
56,032 KB
testcase_05 AC 118 ms
55,948 KB
testcase_06 AC 118 ms
56,144 KB
testcase_07 AC 120 ms
56,132 KB
testcase_08 AC 116 ms
55,684 KB
testcase_09 AC 118 ms
55,780 KB
testcase_10 AC 119 ms
55,808 KB
testcase_11 AC 119 ms
55,948 KB
testcase_12 AC 118 ms
55,792 KB
testcase_13 AC 119 ms
55,836 KB
testcase_14 AC 119 ms
55,824 KB
testcase_15 AC 118 ms
56,228 KB
testcase_16 AC 119 ms
55,764 KB
testcase_17 AC 119 ms
55,796 KB
testcase_18 AC 119 ms
56,044 KB
testcase_19 AC 120 ms
55,772 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