結果

問題 No.2750 Number of Prime Factors
ユーザー mottchanmottchan
提出日時 2024-05-10 22:02:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 890 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-05-10 22:03:00
合計ジャッジ時間 1,630 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 34 ms
10,752 KB
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 32 ms
10,752 KB
testcase_05 AC 33 ms
10,752 KB
testcase_06 AC 32 ms
10,880 KB
testcase_07 AC 31 ms
10,880 KB
testcase_08 AC 33 ms
10,752 KB
testcase_09 AC 31 ms
10,752 KB
testcase_10 AC 33 ms
10,752 KB
testcase_11 AC 33 ms
10,752 KB
testcase_12 AC 34 ms
10,752 KB
testcase_13 AC 31 ms
10,752 KB
testcase_14 AC 31 ms
10,752 KB
testcase_15 AC 32 ms
10,752 KB
testcase_16 AC 33 ms
10,752 KB
testcase_17 AC 31 ms
10,752 KB
testcase_18 AC 31 ms
10,880 KB
testcase_19 AC 31 ms
10,752 KB
testcase_20 AC 31 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
sys.set_int_max_str_digits(0)
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd, lcm, factorial, perm, comb
from itertools import product, permutations, combinations
from functools import lru_cache #@lru_cache(maxsize=128)
#重複あり:list(product(list('123'),repeat = 2)),重複なし:list(permutations(list('123')))
MOD = 998244353

def get_prime(n):
    sieve = [True] * (n + 1) 
    i = 2
    while i * i <= n: 
        if sieve[i]:
            for j in range(i * i, n + 1, i):
                sieve[j] = False
        i += 1
    return [i for i in range(2, n + 1) if sieve[i]]

n = int(input())
l = get_prime(1000)
# print(l)
t=1
for i in range(20):
    t *=l[i]
    if n<t:
        print(i)
        exit()
0