結果

問題 No.1396 Giri
ユーザー titiatitia
提出日時 2021-02-14 21:32:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,304 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 47,464 KB
最終ジャッジ日時 2023-09-29 14:40:54
合計ジャッジ時間 11,343 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,800 KB
testcase_01 AC 13 ms
7,872 KB
testcase_02 AC 1,196 ms
47,388 KB
testcase_03 AC 14 ms
7,832 KB
testcase_04 AC 13 ms
7,980 KB
testcase_05 AC 1,277 ms
47,456 KB
testcase_06 AC 13 ms
7,952 KB
testcase_07 AC 13 ms
7,744 KB
testcase_08 AC 12 ms
7,816 KB
testcase_09 AC 12 ms
7,888 KB
testcase_10 AC 13 ms
7,828 KB
testcase_11 AC 12 ms
7,828 KB
testcase_12 AC 12 ms
7,772 KB
testcase_13 AC 12 ms
7,796 KB
testcase_14 AC 12 ms
7,868 KB
testcase_15 AC 12 ms
7,800 KB
testcase_16 AC 15 ms
7,864 KB
testcase_17 AC 22 ms
8,584 KB
testcase_18 AC 88 ms
11,256 KB
testcase_19 AC 595 ms
28,640 KB
testcase_20 AC 797 ms
36,456 KB
testcase_21 AC 1,117 ms
43,284 KB
testcase_22 AC 1,154 ms
46,776 KB
testcase_23 AC 1,195 ms
47,388 KB
testcase_24 AC 1,269 ms
47,372 KB
testcase_25 AC 1,304 ms
47,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
mod=998244353

P=[i for i in range(N+1)]

for i in range(2,N+1):
    if P[i]!=1:
        for j in range(i+i,N+1,i):
            P[j]//=P[i]

#print(P)

MAX=max(P)

ANS=pow(MAX,mod-2,mod)
for i in range(1,N+1):
    ANS=ANS*P[i]%mod

print(ANS)
            

0