結果
| 問題 | No.1529 Constant Lcm |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-12-31 17:50:08 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 261 bytes |
| 記録 | |
| コンパイル時間 | 380 ms |
| コンパイル使用メモリ | 85,208 KB |
| 実行使用メモリ | 67,836 KB |
| 最終ジャッジ日時 | 2026-04-25 01:29:13 |
| 合計ジャッジ時間 | 2,672 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)