結果
| 問題 |
No.237 作図可能性
|
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2019-05-11 23:15:35 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 2,000 ms |
| コード長 | 743 bytes |
| コンパイル時間 | 185 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-07-02 01:26:31 |
| 合計ジャッジ時間 | 1,902 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
n = int(input())
def prod_2(inlist):
p = 1
for i in inlist:
if i != 0:
p *= i
return p
Fermat_number = [ 2**(2**i)+1 for i in range(5) ]
Felmat_product_list = []
for i in range(32):
s = str(bin(i))[2:]
zero = 5 - len(s)
s = "0"*zero + s
Felmat_product = [ (int(s[i]) * Fermat_number[i]) for i in range(5) ]
Felmat_product_list.append(prod_2(Felmat_product))
Felmat_product_list = sorted(Felmat_product_list)
anslist = []
for i in Felmat_product_list:
if i > n:
break
else:
t = i
j = 0
t2 = t
while t2 <= n:
t2 = t * (2**j)
j += 1
if t2 <= n:
anslist.append(t2)
print(len(anslist)-2)
Konton7