結果

問題 No.1529 Constant Lcm
ユーザー googol_S0googol_S0
提出日時 2021-06-04 21:05:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 310 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 89,152 KB
最終ジャッジ日時 2023-08-12 10:45:37
合計ジャッジ時間 4,008 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,260 KB
testcase_01 AC 76 ms
75,724 KB
testcase_02 AC 72 ms
71,504 KB
testcase_03 AC 73 ms
71,000 KB
testcase_04 WA -
testcase_05 AC 72 ms
71,244 KB
testcase_06 AC 71 ms
71,008 KB
testcase_07 AC 73 ms
71,188 KB
testcase_08 WA -
testcase_09 AC 74 ms
71,216 KB
testcase_10 AC 114 ms
87,796 KB
testcase_11 AC 96 ms
80,644 KB
testcase_12 AC 84 ms
76,844 KB
testcase_13 AC 109 ms
86,080 KB
testcase_14 AC 101 ms
82,348 KB
testcase_15 AC 102 ms
82,788 KB
testcase_16 AC 99 ms
81,212 KB
testcase_17 AC 94 ms
78,988 KB
testcase_18 AC 94 ms
79,068 KB
testcase_19 AC 102 ms
82,708 KB
testcase_20 AC 117 ms
88,868 KB
testcase_21 AC 117 ms
89,032 KB
testcase_22 AC 116 ms
88,884 KB
testcase_23 AC 121 ms
89,152 KB
testcase_24 AC 119 ms
89,128 KB
testcase_25 AC 119 ms
88,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
mod=998244353
P=[]
F=[0]*(N+1)
for i in range(2,N):
  if F[i]:
    continue
  P.append(i)
  for j in range(i,N,i):
    F[j]=1
ANS=1
for i in range(len(P)):
  c=0
  M=N
  while M%P[i]==0:
    M//=P[i]
    c+=1
  x=1
  while N>=x*P[i]:
    x*=P[i]
    c+=1
  ANS=ANS*pow(P[i],c,mod)%mod
print(ANS)
0