結果

問題 No.1529 Constant Lcm
ユーザー 👑 rin204rin204
提出日時 2022-01-27 00:19:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 569 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 96,072 KB
最終ジャッジ日時 2023-08-25 13:35:09
合計ジャッジ時間 4,949 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,180 KB
testcase_01 AC 72 ms
75,872 KB
testcase_02 AC 63 ms
70,868 KB
testcase_03 AC 59 ms
71,004 KB
testcase_04 AC 58 ms
71,288 KB
testcase_05 AC 59 ms
71,220 KB
testcase_06 AC 59 ms
71,208 KB
testcase_07 AC 60 ms
70,976 KB
testcase_08 AC 59 ms
71,188 KB
testcase_09 AC 59 ms
71,184 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 117 ms
83,704 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 189 ms
96,032 KB
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

n = int(input())

isprime = [True] * n
div = {}
for i in range(2, n):
    if not isprime[i]:
        continue
    max_ = 1
    for j in range(i * i, n, i):
        isprime[j] = False
        cnt = 0
        while j % i == 0:
            j //= i
            cnt += 1
        max_ = max(max_, cnt)
    if n % i == 0:
        m = n - i ** max_
        k = 1
        while m >= i ** k:
            k += 1
        max_ += k - 1
    div[i] = max_

ans = 1
for k, v in div.items():
    for _ in range(v):
        ans *= k
        ans %= MOD
print(ans % MOD)

0