結果

問題 No.237 作図可能性
ユーザー tentententen
提出日時 2020-11-18 08:40:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 2,087 ms
コンパイル使用メモリ 71,712 KB
実行使用メモリ 57,608 KB
最終ジャッジ日時 2023-09-30 14:50:49
合計ジャッジ時間 6,998 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,084 KB
testcase_01 AC 120 ms
56,500 KB
testcase_02 AC 120 ms
55,884 KB
testcase_03 AC 119 ms
55,696 KB
testcase_04 AC 123 ms
56,092 KB
testcase_05 AC 122 ms
55,964 KB
testcase_06 AC 120 ms
56,344 KB
testcase_07 AC 120 ms
55,388 KB
testcase_08 AC 120 ms
56,104 KB
testcase_09 AC 120 ms
56,152 KB
testcase_10 AC 122 ms
55,816 KB
testcase_11 AC 119 ms
54,324 KB
testcase_12 AC 120 ms
55,956 KB
testcase_13 AC 120 ms
56,052 KB
testcase_14 AC 119 ms
56,056 KB
testcase_15 AC 120 ms
55,792 KB
testcase_16 AC 121 ms
56,144 KB
testcase_17 AC 120 ms
56,068 KB
testcase_18 AC 119 ms
56,200 KB
testcase_19 AC 119 ms
55,636 KB
testcase_20 AC 118 ms
55,644 KB
testcase_21 AC 119 ms
57,608 KB
testcase_22 AC 120 ms
56,064 KB
testcase_23 AC 119 ms
55,620 KB
testcase_24 AC 119 ms
55,956 KB
testcase_25 AC 120 ms
56,076 KB
testcase_26 AC 119 ms
56,328 KB
testcase_27 AC 120 ms
56,076 KB
testcase_28 AC 117 ms
55,716 KB
testcase_29 AC 117 ms
56,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] felm = new long[]{3, 5, 17, 257, 65537};
        long[] probable = new long[1 << 5];
        for (int i = 0; i < (1 << 5); i++) {
            int x = i;
            probable[i] = 1;
            for (int j = 0; j < 5; j++) {
                if (x % 2 == 1) {
                    probable[i] *= felm[j];
                }
                x /= 2;
            }
        }
        int count = 0;
        for (long x : probable) {
            long y = x;
            while (y <= n) {
                count++;
                y *= 2;
            }
        }
        System.out.println(count - 2);
    }
}
0