結果

問題 No.2750 Number of Prime Factors
コンテスト
ユーザー Kohei
提出日時 2026-07-18 20:46:03
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 66 ms / 2,000 ms
+ 762µs
コード長 461 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 501 ms
コンパイル使用メモリ 95,600 KB
実行使用メモリ 83,072 KB
最終ジャッジ日時 2026-07-18 20:46:07
合計ジャッジ時間 3,202 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())
cur = 1

limit = 10**3
distinct_prime_factor_count = [0]*(limit+1)
primes = []
for i in range(2, limit+1):
    if distinct_prime_factor_count[i] == 0:
        primes.append(i)
        for num in range(i, limit+1, i):
            distinct_prime_factor_count[num] += 1

cnt = 0
for prime in primes:
    # prime を掛けて N を超えたら break
    if cur * prime > N:
        break
    else:
        cur *= prime
        cnt += 1

print(cnt)
0