結果

問題 No.237 作図可能性
ユーザー Grenache
提出日時 2015-07-05 23:50:19
言語 Java
(openjdk 23)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 638 bytes
コンパイル時間 3,519 ms
コンパイル使用メモリ 74,060 KB
実行使用メモリ 41,288 KB
最終ジャッジ日時 2024-07-08 01:03:52
合計ジャッジ時間 6,997 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder237 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();

        long[] num = {2, 4, 16, 256, 65536, 3, 5, 17, 257, 65537};
        
        int ret = 0;
        for (int i = 1; i < 1 << num.length; i++) {
        	long tmp = 1;
        	for (int j = 0; j < num.length; j++) {
        		if ((i & (0x1 << j)) != 0) {
        			tmp *= num[j];
        		}
        	}
        	if (tmp <= a) {
        		ret++;
        	}
        }
        
        System.out.println(ret - 1);
        
        sc.close();
    }
}
0