結果

問題 No.237 作図可能性
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-12-03 17:50:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 954 bytes
コンパイル時間 1,932 ms
コンパイル使用メモリ 74,440 KB
実行使用メモリ 57,900 KB
最終ジャッジ日時 2023-08-18 12:52:33
合計ジャッジ時間 7,083 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,856 KB
testcase_01 AC 123 ms
55,884 KB
testcase_02 AC 120 ms
55,620 KB
testcase_03 AC 116 ms
55,880 KB
testcase_04 AC 122 ms
55,760 KB
testcase_05 AC 122 ms
55,856 KB
testcase_06 AC 118 ms
55,624 KB
testcase_07 AC 121 ms
55,748 KB
testcase_08 AC 114 ms
55,876 KB
testcase_09 AC 111 ms
55,972 KB
testcase_10 AC 112 ms
55,904 KB
testcase_11 AC 114 ms
55,764 KB
testcase_12 AC 116 ms
55,832 KB
testcase_13 AC 116 ms
57,900 KB
testcase_14 AC 114 ms
55,760 KB
testcase_15 AC 115 ms
55,596 KB
testcase_16 AC 112 ms
56,448 KB
testcase_17 AC 114 ms
55,596 KB
testcase_18 AC 112 ms
55,756 KB
testcase_19 AC 113 ms
55,840 KB
testcase_20 AC 114 ms
56,012 KB
testcase_21 AC 116 ms
55,864 KB
testcase_22 AC 118 ms
55,324 KB
testcase_23 AC 117 ms
56,020 KB
testcase_24 AC 117 ms
55,900 KB
testcase_25 AC 121 ms
55,324 KB
testcase_26 AC 115 ms
55,864 KB
testcase_27 AC 116 ms
55,888 KB
testcase_28 AC 117 ms
55,912 KB
testcase_29 AC 113 ms
56,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long [] F = {3L,5L,17L,257L,65537L};
        long [] m = new long [30];
        for(int i=0; i<30; i++){
            m[i]=(long)Math.pow(2,i);
        }
        ArrayList<Long> Fpr = new ArrayList<Long>();
        Fpr.add(1L);
        for(int i=0; i<5; i++){
            int L=Fpr.size();
            for(int j=0; j<L; j++){
                Fpr.add(Fpr.get(j)*F[i]);
            }
        }
        ArrayList<Long> array = new ArrayList<Long>();
        for(int i=0; i<30; i++){
            for(int j=0; j<Fpr.size(); j++){
                array.add(Fpr.get(j)*m[i]);
            }
        }
        int c=0;
        for(int j=0; j<array.size(); j++){
            if(3<=array.get(j)&&array.get(j)<=N){
                c++;
            }
        }
        System.out.println(c);
    }
}
0