結果

問題 No.1529 Constant Lcm
ユーザー O2MTO2MT
提出日時 2021-06-04 22:16:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 262 bytes
コンパイル時間 1,576 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 82,080 KB
最終ジャッジ日時 2023-08-12 13:28:43
合計ジャッジ時間 6,488 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
75,176 KB
testcase_01 AC 81 ms
74,692 KB
testcase_02 WA -
testcase_03 AC 70 ms
71,148 KB
testcase_04 AC 69 ms
71,020 KB
testcase_05 AC 69 ms
71,200 KB
testcase_06 AC 68 ms
70,868 KB
testcase_07 AC 71 ms
70,900 KB
testcase_08 AC 69 ms
71,020 KB
testcase_09 AC 70 ms
70,836 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 #

def gcd(x, y):
  if y == 0:
      return x
  else:
      return gcd(y,x%y)

 #最小公倍数
def lcm(a,b):
  return a*(b//gcd(a,b))

N = int(input())
MOD = 998244353
num = lcm(N-1,2*(N-2))
for i in range(3,N//2+1):
  num = lcm(num,i*(N-i))
num %= MOD
print(num)
0