結果

問題 No.1396 Giri
ユーザー ayaoniayaoni
提出日時 2021-02-17 02:58:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 1,128 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 89,800 KB
最終ジャッジ日時 2023-10-11 15:43:51
合計ジャッジ時間 4,119 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,596 KB
testcase_01 AC 75 ms
71,536 KB
testcase_02 AC 107 ms
89,272 KB
testcase_03 AC 73 ms
71,272 KB
testcase_04 AC 75 ms
71,272 KB
testcase_05 AC 105 ms
89,136 KB
testcase_06 AC 75 ms
71,364 KB
testcase_07 AC 74 ms
71,552 KB
testcase_08 AC 76 ms
71,572 KB
testcase_09 AC 75 ms
71,568 KB
testcase_10 AC 77 ms
71,560 KB
testcase_11 AC 75 ms
71,584 KB
testcase_12 AC 74 ms
71,116 KB
testcase_13 AC 74 ms
71,484 KB
testcase_14 AC 74 ms
71,532 KB
testcase_15 AC 76 ms
71,596 KB
testcase_16 AC 79 ms
75,556 KB
testcase_17 AC 84 ms
76,232 KB
testcase_18 AC 83 ms
77,316 KB
testcase_19 AC 93 ms
83,016 KB
testcase_20 AC 103 ms
85,764 KB
testcase_21 AC 103 ms
88,080 KB
testcase_22 AC 106 ms
89,496 KB
testcase_23 AC 105 ms
89,508 KB
testcase_24 AC 103 ms
89,608 KB
testcase_25 AC 103 ms
89,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import gcd
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N = I()


def sieve_of_eratosthenes(n):  # n以下の素数の全列挙
    prime_list = []
    is_prime = [1]*(n+1)  # A[i] = iが素数なら1,その他は0
    is_prime[0] = is_prime[1] = 0
    for i in range(2,int(n**.5)+1):
        if is_prime[i]:
            prime_list.append(i)
            for j in range(i**2,n+1,i):
                is_prime[j] = 0
    for i in range(int(n**.5)+1,n+1):
        if is_prime[i] == 1:
            prime_list.append(i)
    return prime_list


prime_list = sieve_of_eratosthenes(N)

ans = 1
mod = 998244353
for p in prime_list[:-1]:
    a = 1
    while a*p <= N:
        a *= p
    ans *= a
    ans %= mod

print(ans)
0