結果

問題 No.237 作図可能性
ユーザー ssmkzkssmkzk
提出日時 2019-06-18 16:45:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 129 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 8,812 KB
最終ジャッジ日時 2023-08-20 07:03:45
合計ジャッジ時間 2,113 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
8,792 KB
testcase_01 AC 22 ms
8,764 KB
testcase_02 AC 21 ms
8,612 KB
testcase_03 AC 20 ms
8,756 KB
testcase_04 AC 20 ms
8,736 KB
testcase_05 AC 19 ms
8,572 KB
testcase_06 AC 19 ms
8,764 KB
testcase_07 AC 22 ms
8,604 KB
testcase_08 AC 22 ms
8,704 KB
testcase_09 AC 21 ms
8,812 KB
testcase_10 AC 22 ms
8,660 KB
testcase_11 AC 21 ms
8,636 KB
testcase_12 AC 21 ms
8,684 KB
testcase_13 AC 22 ms
8,780 KB
testcase_14 AC 22 ms
8,648 KB
testcase_15 AC 21 ms
8,792 KB
testcase_16 AC 22 ms
8,752 KB
testcase_17 AC 21 ms
8,644 KB
testcase_18 AC 22 ms
8,772 KB
testcase_19 AC 22 ms
8,656 KB
testcase_20 AC 23 ms
8,632 KB
testcase_21 AC 23 ms
8,632 KB
testcase_22 AC 23 ms
8,616 KB
testcase_23 AC 22 ms
8,652 KB
testcase_24 AC 23 ms
8,612 KB
testcase_25 AC 22 ms
8,752 KB
testcase_26 AC 23 ms
8,612 KB
testcase_27 AC 21 ms
8,772 KB
testcase_28 AC 19 ms
8,608 KB
testcase_29 AC 20 ms
8,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
from functools import reduce
from operator import mul

A = int(input())
fermat_n = [3,5,17,257,65537]
use_l = [3,5,17,257,65537]
for i in range(2, 6):
    l = list((itertools.combinations(fermat_n, i)))
    for l_i in l:
        use_l.append(reduce(mul,l_i))
use_l.append(1)
use_l.sort()


ans = 0
s = set()
for i in range(31):
    power_of_two = pow(2,i)
    for l_i in use_l:
        if A >= power_of_two * l_i:
            s.add(power_of_two * l_i)
print(len(s)-2)
0