結果

問題 No.1529 Constant Lcm
ユーザー hirakuhiraku
提出日時 2021-06-04 21:08:48
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 550 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 83,584 KB
最終ジャッジ日時 2024-04-30 01:03:20
合計ジャッジ時間 5,317 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
58,752 KB
testcase_01 AC 91 ms
70,656 KB
testcase_02 AC 45 ms
53,248 KB
testcase_03 AC 45 ms
53,376 KB
testcase_04 AC 45 ms
53,248 KB
testcase_05 AC 45 ms
53,632 KB
testcase_06 AC 48 ms
53,760 KB
testcase_07 AC 45 ms
53,248 KB
testcase_08 AC 46 ms
53,504 KB
testcase_09 AC 47 ms
53,120 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter


# 素因数分解(Counter)
def prime_factorize(n):
    a = Counter()
    while n % 2 == 0:
        a[2] += 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a[f] += 1
            n //= f
        else:
            f += 2
    if n != 1:
        a[n] += 1
    return a


n = int(input())

MOD = 998244353

l = Counter()
for i in range(1, n // 2 + 1):
    l |= prime_factorize(i * (n - i))

ans = 1
for k, v in list(l.items()):
    ans *= pow(k, v, MOD)
    ans %= MOD

print(ans)
0