結果

問題 No.237 作図可能性
ユーザー tsunabittsunabit
提出日時 2020-03-18 18:26:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 4,034 ms
コンパイル使用メモリ 73,284 KB
実行使用メモリ 56,236 KB
最終ジャッジ日時 2023-08-20 20:08:41
合計ジャッジ時間 7,852 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
55,864 KB
testcase_01 AC 101 ms
55,968 KB
testcase_02 AC 102 ms
55,996 KB
testcase_03 AC 101 ms
55,848 KB
testcase_04 AC 113 ms
55,928 KB
testcase_05 AC 102 ms
55,900 KB
testcase_06 AC 102 ms
55,900 KB
testcase_07 AC 100 ms
55,708 KB
testcase_08 AC 103 ms
55,968 KB
testcase_09 AC 103 ms
55,984 KB
testcase_10 AC 106 ms
55,848 KB
testcase_11 AC 103 ms
55,908 KB
testcase_12 AC 103 ms
55,924 KB
testcase_13 AC 106 ms
55,800 KB
testcase_14 AC 104 ms
55,992 KB
testcase_15 AC 107 ms
55,704 KB
testcase_16 AC 125 ms
55,648 KB
testcase_17 AC 106 ms
55,704 KB
testcase_18 AC 102 ms
55,912 KB
testcase_19 AC 105 ms
55,444 KB
testcase_20 AC 102 ms
55,800 KB
testcase_21 AC 102 ms
55,556 KB
testcase_22 AC 102 ms
56,012 KB
testcase_23 AC 102 ms
55,572 KB
testcase_24 AC 100 ms
55,436 KB
testcase_25 AC 103 ms
55,676 KB
testcase_26 AC 100 ms
56,044 KB
testcase_27 AC 100 ms
55,828 KB
testcase_28 AC 104 ms
55,628 KB
testcase_29 AC 105 ms
56,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No237 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long[] f = {3, 5, 17, 257, 65537};
		int c = 0;
		for(int i = 0; i < 30; i++) {
			for (int j = 0; j < (1 << 5); j++) {
				long ans = (long)Math.pow(2, i);
				for (int k = 0; k < 5; k++) if ((1 & j>>k) == 1) ans *= f[k];
				if(2 < ans && ans <= a) c++;
			}
		}
		System.out.println(c);
	}
}
0