問題一覧 > 通常問題

No.1396 Giri

レベル : / AI推定難易度 : 1400 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 166
作問者 : evima / テスター : 夕叢霧香(ゆうむらきりか) iaNTU
お気に入りにしたユーザー ProblemId : 5883 / 自分の提出
問題文最終更新日: 2021-02-28 20:34:19
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
バレンタインコンテスト2021 (順位表) の他の問題:

Problem Statement

Find the smallest positive integer that is a multiple of at least $N - 1$ of the integers $1, 2, \ldots, N$, and output it modulo $998244353$.

(The story is left to your imagination.)

Input

$N$

  • $2 \leq N \leq 10^6$
  • $N$ is an integer.

Output

Output the answer, followed by a newline.

Sample

Sample 1
Input
2
Output
1

$1$ is a multiple of $1$.

Sample 2
Input
4
Output
4

$4$ is a multiple of $1, 2, 4$.

Sample 3
Input
1000000
Output
581637558

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。