結果

問題 No.773 コンテスト
ユーザー kohaku_kohaku
提出日時 2019-02-19 21:24:32
言語 Java
(openjdk 23)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 2,031 ms
コンパイル使用メモリ 74,636 KB
実行使用メモリ 54,196 KB
最終ジャッジ日時 2024-10-12 20:25:15
合計ジャッジ時間 6,111 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

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