結果

問題 No.1396 Giri
ユーザー aaaaaaaaaa2230
提出日時 2021-04-22 17:34:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,552 KB
実行使用メモリ 79,164 KB
最終ジャッジ日時 2024-07-04 06:28:15
合計ジャッジ時間 2,475 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
mod = 998244353

count = [0]*(n+1)
primes = []
for i in range(2,n+1):
    if count[i]:
        continue
    primes.append(i)
    for j in range(i,n+1,i):
        count[j] = 1

ans = 1
for p in primes[:len(primes)-1]:
    now = p
    while now <= n:
        ans *= p
        ans %= mod
        now *= p
    
print(ans)
0