結果

問題 No.237 作図可能性
ユーザー ぴろずぴろず
提出日時 2015-07-05 22:33:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 4,177 ms
コンパイル使用メモリ 72,548 KB
実行使用メモリ 55,772 KB
最終ジャッジ日時 2023-09-22 06:33:07
合計ジャッジ時間 8,647 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
55,364 KB
testcase_01 AC 137 ms
55,656 KB
testcase_02 AC 129 ms
55,748 KB
testcase_03 AC 128 ms
55,312 KB
testcase_04 AC 132 ms
55,312 KB
testcase_05 AC 131 ms
55,524 KB
testcase_06 AC 130 ms
55,360 KB
testcase_07 AC 129 ms
55,584 KB
testcase_08 AC 136 ms
55,488 KB
testcase_09 AC 129 ms
55,320 KB
testcase_10 AC 131 ms
55,536 KB
testcase_11 AC 129 ms
55,648 KB
testcase_12 AC 130 ms
55,696 KB
testcase_13 AC 131 ms
55,532 KB
testcase_14 AC 132 ms
55,312 KB
testcase_15 AC 132 ms
55,548 KB
testcase_16 AC 141 ms
55,368 KB
testcase_17 AC 132 ms
55,728 KB
testcase_18 AC 133 ms
55,576 KB
testcase_19 AC 132 ms
55,608 KB
testcase_20 AC 133 ms
55,444 KB
testcase_21 AC 134 ms
55,588 KB
testcase_22 AC 132 ms
55,580 KB
testcase_23 AC 134 ms
55,432 KB
testcase_24 AC 136 ms
55,772 KB
testcase_25 AC 136 ms
55,268 KB
testcase_26 AC 133 ms
55,388 KB
testcase_27 AC 130 ms
55,536 KB
testcase_28 AC 129 ms
55,308 KB
testcase_29 AC 132 ms
55,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no237;

import java.util.HashSet;
import java.util.Scanner;

public class Main {
	public static long[] felmatPrime = {3,5,17,257,65537};
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		HashSet<Long> hs = new HashSet<>();
		for(int i=0;i<32;i++) {
			long x = 1;
			for(int j=0;j<5;j++) {
				if ((i >> j & 1) == 1) {
					x *= felmatPrime[j];
				}
			}
			while(x <= a) {
				hs.add(x);
				x <<= 1;
			}
		}
		System.out.println(hs.size() - 2);
	}

}
0