結果

問題 No.1396 Giri
ユーザー marroncastlemarroncastle
提出日時 2021-02-14 21:35:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 641 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 89,216 KB
最終ジャッジ日時 2023-09-29 14:47:08
合計ジャッジ時間 5,251 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
71,520 KB
testcase_01 AC 66 ms
71,336 KB
testcase_02 WA -
testcase_03 AC 59 ms
71,572 KB
testcase_04 AC 58 ms
71,408 KB
testcase_05 WA -
testcase_06 AC 60 ms
71,512 KB
testcase_07 AC 59 ms
71,324 KB
testcase_08 AC 61 ms
71,416 KB
testcase_09 AC 61 ms
71,564 KB
testcase_10 AC 60 ms
71,516 KB
testcase_11 AC 58 ms
71,552 KB
testcase_12 AC 58 ms
71,424 KB
testcase_13 AC 60 ms
71,424 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def max_sieve(n):
  is_prime = [True for _ in range(n+1)]
  is_prime[1] = False
  for i in range(2, n+1):
    if is_prime[i]:
      j = 2 * i
      while j <= n:
        is_prime[j] = False
        j += i
  table = [i for i in range(1, n+1) if is_prime[i]]
  return table[-1]
MOD = 998244353
N = int(input())
p = max_sieve(N)
ans = 1
from math import gcd
for i in range(1,N+1):
  if i==p: continue
  g = gcd(ans,i)
  ans *= i//g
  ans %= MOD
print(ans)
0