結果

問題 No.237 作図可能性
ユーザー suiginginsuigingin
提出日時 2015-07-06 01:55:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 713 bytes
コンパイル時間 4,720 ms
コンパイル使用メモリ 73,292 KB
実行使用メモリ 56,236 KB
最終ジャッジ日時 2023-09-22 09:04:08
合計ジャッジ時間 9,557 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,700 KB
testcase_01 AC 120 ms
55,628 KB
testcase_02 AC 117 ms
55,348 KB
testcase_03 AC 117 ms
55,704 KB
testcase_04 AC 120 ms
56,236 KB
testcase_05 AC 122 ms
55,848 KB
testcase_06 AC 123 ms
55,716 KB
testcase_07 AC 119 ms
55,684 KB
testcase_08 AC 123 ms
55,696 KB
testcase_09 AC 120 ms
55,624 KB
testcase_10 AC 122 ms
55,720 KB
testcase_11 AC 118 ms
55,620 KB
testcase_12 AC 119 ms
55,492 KB
testcase_13 AC 123 ms
55,864 KB
testcase_14 AC 119 ms
55,400 KB
testcase_15 AC 121 ms
55,700 KB
testcase_16 AC 122 ms
53,948 KB
testcase_17 AC 121 ms
55,868 KB
testcase_18 AC 119 ms
55,704 KB
testcase_19 AC 124 ms
55,924 KB
testcase_20 AC 121 ms
55,412 KB
testcase_21 AC 123 ms
55,628 KB
testcase_22 AC 125 ms
55,716 KB
testcase_23 AC 121 ms
55,860 KB
testcase_24 AC 121 ms
55,700 KB
testcase_25 AC 124 ms
55,428 KB
testcase_26 AC 122 ms
55,968 KB
testcase_27 AC 123 ms
55,864 KB
testcase_28 AC 125 ms
55,904 KB
testcase_29 AC 121 ms
55,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.TreeSet;

public class No_237 {
	Scanner sc = new Scanner(System.in);
	int M = 1000000000;

	void run() {
		int n = sc.nextInt();
		TreeSet<Long> set = new TreeSet<>();
		int[] F = { 3, 5, 17, 257, 65537 };
		for (int mask = 0; mask < 1 << F.length; mask++) {
			long base = 1;
			for (int j = 0; j < F.length; j++) {
				if (((mask >> j) & 1) == 1) {
					base *= F[j];
				}
			}
			while (base <= M) {
				set.add(base);
				base *= 2;
			}
		}
	
		set.remove(1L);
		set.remove(2L);
		
		int cnt = 0;
		for (long ele : set) {
			if(ele <= n) cnt++;
			else break;
		}
		System.out.println(cnt);
	}

	public static void main(String[] args) {
		new No_237().run();
	}
}
0