結果

問題 No.773 コンテスト
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2019-02-19 21:24:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 1,822 ms
コンパイル使用メモリ 74,636 KB
実行使用メモリ 41,552 KB
最終ジャッジ日時 2024-04-20 22:07:35
合計ジャッジ時間 5,431 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
41,512 KB
testcase_01 AC 114 ms
41,092 KB
testcase_02 AC 104 ms
41,540 KB
testcase_03 AC 115 ms
41,240 KB
testcase_04 AC 107 ms
40,508 KB
testcase_05 AC 105 ms
40,112 KB
testcase_06 AC 107 ms
40,096 KB
testcase_07 AC 116 ms
41,200 KB
testcase_08 AC 116 ms
41,160 KB
testcase_09 AC 120 ms
41,168 KB
testcase_10 AC 102 ms
40,396 KB
testcase_11 AC 120 ms
41,192 KB
testcase_12 AC 115 ms
41,104 KB
testcase_13 AC 110 ms
39,884 KB
testcase_14 AC 106 ms
39,896 KB
testcase_15 AC 107 ms
41,252 KB
testcase_16 AC 104 ms
41,496 KB
testcase_17 AC 113 ms
41,164 KB
testcase_18 AC 117 ms
41,416 KB
testcase_19 AC 115 ms
41,552 KB
testcase_20 AC 113 ms
41,424 KB
testcase_21 AC 113 ms
41,212 KB
testcase_22 AC 104 ms
40,208 KB
testcase_23 AC 112 ms
41,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        solve(a,b);
    }
    
    static void solve(int a, int b) {
        boolean [] boo = new boolean [32];
        Arrays.fill(boo, false);
        for(int i=a; i<=b; i++) {
            boo[i] = true;
        }
        int ans = count(boo);
        System.out.println(ans);
    }
    
    static int count(boolean[]boo) {
        int ans = 0;
        final int[] ARRAY = {23, 24, 25};
        for(int i=0; i<ARRAY.length; i++) {
            if(!boo[ARRAY[i]]) ans++;
        }
        return ans;
    }

}
0