結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
57,088 KB
testcase_01 AC 50 ms
57,472 KB
testcase_02 AC 43 ms
51,584 KB
testcase_03 AC 43 ms
51,840 KB
testcase_04 AC 44 ms
51,712 KB
testcase_05 AC 42 ms
51,456 KB
testcase_06 AC 43 ms
51,584 KB
testcase_07 AC 43 ms
51,584 KB
testcase_08 AC 43 ms
51,840 KB
testcase_09 AC 42 ms
51,968 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