結果
| 問題 |
No.1529 Constant Lcm
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-12-31 17:50:08 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 261 bytes |
| コンパイル時間 | 357 ms |
| コンパイル使用メモリ | 82,404 KB |
| 実行使用メモリ | 67,104 KB |
| 最終ジャッジ日時 | 2024-10-08 17:59:32 |
| 合計ジャッジ時間 | 2,687 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 24 |
ソースコード
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
while i <= N - i:
ans = lcm(ans,i * (N - i))
i += 1
print(ans%P)