結果

問題 No.237 作図可能性
ユーザー htensaihtensai
提出日時 2020-01-26 12:32:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 814 bytes
コンパイル時間 3,426 ms
コンパイル使用メモリ 72,948 KB
実行使用メモリ 56,528 KB
最終ジャッジ日時 2023-10-12 12:03:26
合計ジャッジ時間 7,317 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,188 KB
testcase_01 AC 120 ms
56,308 KB
testcase_02 AC 119 ms
55,988 KB
testcase_03 AC 120 ms
55,816 KB
testcase_04 AC 120 ms
56,484 KB
testcase_05 AC 120 ms
56,528 KB
testcase_06 AC 121 ms
55,960 KB
testcase_07 AC 122 ms
56,016 KB
testcase_08 AC 121 ms
56,056 KB
testcase_09 AC 120 ms
56,140 KB
testcase_10 AC 119 ms
55,740 KB
testcase_11 AC 120 ms
56,220 KB
testcase_12 AC 119 ms
56,044 KB
testcase_13 AC 120 ms
55,552 KB
testcase_14 AC 120 ms
55,896 KB
testcase_15 AC 120 ms
56,092 KB
testcase_16 AC 119 ms
56,012 KB
testcase_17 AC 120 ms
55,832 KB
testcase_18 AC 122 ms
55,872 KB
testcase_19 AC 120 ms
55,656 KB
testcase_20 AC 120 ms
55,664 KB
testcase_21 AC 120 ms
55,640 KB
testcase_22 AC 120 ms
55,856 KB
testcase_23 AC 120 ms
55,752 KB
testcase_24 AC 120 ms
55,992 KB
testcase_25 AC 119 ms
56,044 KB
testcase_26 AC 121 ms
56,184 KB
testcase_27 AC 121 ms
55,952 KB
testcase_28 AC 120 ms
55,540 KB
testcase_29 AC 120 ms
55,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] fel = new int[]{3, 5, 17, 257, 65537};
        HashSet<Long> set = new HashSet<>();
        for (int i = 0; i < Math.pow(2, 6); i++) {
            int x = i;
            long value = 1;
            for (int j = 0; j < 5; j++) {
                if (x % 2 == 1) {
                    value *= fel[j];
                }
                x /= 2;
            }
            set.add(value);
        }
        int count = 0;
        for (long x : set) {
            while(x <= n) {
                if (x > 2) {
                    count++;
                }
                x *= 2;
            }
        }
        System.out.println(count);
    }
}
0