結果
問題 | No.1529 Constant Lcm |
ユーザー |
![]() |
提出日時 | 2021-06-04 20:30:37 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,215 bytes |
コンパイル時間 | 206 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 64,712 KB |
最終ジャッジ日時 | 2024-11-19 09:16:42 |
合計ジャッジ時間 | 62,455 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 TLE * 15 |
ソースコード
import bisect,collections,copy,heapq,itertools,math,string,sys,queue,time input = lambda: sys.stdin.readline().rstrip() def I(): return input() def IS(): return input().split() def II(): return int(input()) def IIS(): return map(int,input().split()) def LIIS(): return list(map(int,input().split())) def debug(*args): print(*args) if len(args)>0 else print(False);return start_time=time.time() def nt(): print(time.time()-start_time);return def chmax(a: list, b: list) -> bool: assert len(a) == len(b) == 1, "1要素のlistを指定してください" if a[0] < b[0]: a[0] = b[0] return True return False def chmin(a: list, b: list) -> bool: assert len(a) == len(b) == 1, "1要素のlistを指定してください" if a[0] > b[0]: a[0] = b[0] return True return False def combinations_count(n, r): return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) ragen=range INF=10**10 MOD=998244353 from decimal import Decimal as d ############################################################################## n=II() A=[] for i in range(n-1): A.append((i+1)*(n-i-1)) ans=1 for i in range(n-1): ans=math.lcm(ans,A[i]) print(ans%MOD)