結果

問題 No.2902 ZERO!!
ユーザー 2000 Ekiben2000 Ekiben
提出日時 2024-09-27 22:36:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 834 bytes
コンパイル時間 232 ms
コンパイル使用メモリ 82,464 KB
実行使用メモリ 100,224 KB
最終ジャッジ日時 2024-09-27 22:36:18
合計ジャッジ時間 5,759 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,968 KB
testcase_01 AC 35 ms
51,968 KB
testcase_02 AC 224 ms
97,664 KB
testcase_03 AC 36 ms
52,352 KB
testcase_04 AC 94 ms
74,240 KB
testcase_05 AC 133 ms
83,552 KB
testcase_06 AC 226 ms
100,224 KB
testcase_07 AC 102 ms
76,672 KB
testcase_08 AC 221 ms
93,952 KB
testcase_09 AC 202 ms
96,512 KB
testcase_10 AC 161 ms
89,344 KB
testcase_11 AC 142 ms
85,248 KB
testcase_12 AC 64 ms
68,736 KB
testcase_13 AC 218 ms
98,048 KB
testcase_14 AC 163 ms
89,856 KB
testcase_15 AC 209 ms
93,312 KB
testcase_16 AC 130 ms
82,048 KB
testcase_17 AC 194 ms
93,568 KB
testcase_18 AC 194 ms
93,972 KB
testcase_19 AC 168 ms
89,472 KB
testcase_20 AC 156 ms
88,036 KB
testcase_21 AC 163 ms
89,600 KB
testcase_22 AC 108 ms
78,208 KB
testcase_23 AC 134 ms
82,816 KB
testcase_24 AC 43 ms
59,648 KB
testcase_25 AC 45 ms
60,800 KB
testcase_26 AC 41 ms
59,392 KB
testcase_27 AC 45 ms
60,928 KB
testcase_28 AC 42 ms
59,520 KB
testcase_29 AC 42 ms
60,032 KB
testcase_30 AC 46 ms
60,672 KB
testcase_31 AC 45 ms
60,544 KB
testcase_32 AC 42 ms
60,288 KB
testcase_33 AC 45 ms
60,032 KB
testcase_34 AC 37 ms
52,480 KB
testcase_35 AC 43 ms
60,288 KB
testcase_36 AC 43 ms
60,544 KB
testcase_37 AC 44 ms
60,416 KB
testcase_38 AC 45 ms
59,904 KB
testcase_39 AC 36 ms
52,352 KB
testcase_40 AC 38 ms
53,120 KB
testcase_41 AC 43 ms
52,608 KB
testcase_42 AC 46 ms
61,056 KB
testcase_43 AC 37 ms
52,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

MOD = 998244353
N = int(input())
e_p = {}
is_prime = [True] * (N + 1)
for i in range(2, int(N ** 0.5) + 1):
    if is_prime[i]:
        for j in range(i * i, N + 1, i):
            is_prime[j] = False
primes = [i for i in range(2, N + 1) if is_prime[i]]
max_e = 0
e_p_list = []
for p in primes:
    e = 0
    n = N
    while n:
        n //= p
        e += n
    e_p_list.append(e)
    max_e = max(max_e, e)
E = max_e
T = [1] * (E + 2)
for e in e_p_list:
    c = e
    k = 1
    while c > 0:
        k_l = e // (c + 1) + 1
        k_r = e // c if c > 0 else e
        if k_l > k_r:
            c -= 1
            continue
        for k in range(k_l, k_r + 1):
            T[k] = T[k] * (c + 1) % MOD
        c -= 1
a = 0
for k in range(1, E + 1):
    diff = (T[k] - T[k + 1]) % MOD
    a = (a + k * diff) % MOD
print(a)

0