問題一覧 > 通常問題

No.2081 Make a Test Case of GCD Subset

レベル : / AI推定難易度 : 1975 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 43
作問者 : taiga0629kyopro / テスター : ygussany hari64
お気に入りにしたユーザー ProblemId : 8496 / 自分の提出
問題文最終更新日: 2022-09-17 20:44:26
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
yukicoder contest 361 (順位表) の他の問題:

Problem Statement

taiga created the following problem.

GCD Subset

You are given a sequence $A$ of positive integers of length $N$. Here, all elements of $A$ are distinct. A non-empty subset $S=\lbrace S_1,S_2,\dots,S_k \rbrace$ of $\lbrace 1,2, \dots ,N \rbrace$ is called a good set if it satisfies the following condition.

  • $\gcd(A_{S_1},A_{S_2},\dots,A_{S_k}) \ge 2$ (where $\gcd(X_1,X_2,\dots,X_k)$ denotes the greatest common divisor of $X_1,X_2,\dots,X_k$.)

There are $2^N-1$ non-empty subsets of $\lbrace 1,2, \dots ,N \rbrace$. Find the number of good sets among them, modulo $998244353$.

You are given an integer $M$. Output $1$ sequence $A$ for which the answer to the problem "GCD Subset" is $M$.

Input

$M$

  • $0 \le M < 998244353$
  • All inputs are integers.
  • Output

    Output the length $N$ of the sequence on line $1$ and the sequence $A$ on line $2$, as shown below. If there are multiple valid answers, any of them will be accepted.

    $N$
    $A_1$ $A_2$ $\dots$ $A_N$

    The output must also satisfy the following constraints.

    Output Constraints

  • $1 \le N \le 10^5$
  • $1 \le A_i \le 10^5$
  • All elements of $A$ are distinct.
  • All outputs are integers.
  • Sample

    Sample 1
    Input
    3
    Output
    3
    1 3 6

    With $N=3$, $A=(1,3,6)$, the good sets are $\lbrace 2 \rbrace, \lbrace 3 \rbrace, \lbrace 2,3 \rbrace$, which is $3$ sets, so the condition is satisfied. Other outputs are also accepted, for example one for which the number of good sets is $998244353+3$.

    Note that output in the following format will be judged incorrect.

    3
    1
    3
    6

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