結果

問題 No.1529 Constant Lcm
ユーザー ああいいああいい
提出日時 2021-12-31 17:52:10
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 269 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 83,408 KB
最終ジャッジ日時 2024-04-17 05:59:08
合計ジャッジ時間 5,170 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
59,348 KB
testcase_01 AC 43 ms
57,856 KB
testcase_02 AC 38 ms
52,328 KB
testcase_03 AC 37 ms
53,200 KB
testcase_04 AC 36 ms
53,220 KB
testcase_05 AC 36 ms
52,944 KB
testcase_06 AC 37 ms
52,824 KB
testcase_07 AC 38 ms
53,220 KB
testcase_08 AC 36 ms
53,348 KB
testcase_09 AC 37 ms
53,632 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 #

N = int(input())
P = 998244353

def lcm(a,b):
    u,v = a,b
    while True:
        r = a % b
        a = b
        b = r
        if r == 0:
            break
    return u // a * v
ans = 1
i = 1
while i <= N - i:
    ans = lcm(ans,i * (N - i))
    i += 1
print(ans % P)
0