問題一覧 > 通常問題

No.1114 Addition Spilled Is Not Returned to the Tray

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 281
作問者 : 37zigen / テスター : Kiri8128
お気に入りにしたユーザー ProblemId : 4703 / 自分の提出
問題文最終更新日: 2020-08-22 17:25:00
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 257 (順位表) の他の問題:

Problem Statement

Suppose that an $n$-element subset $\{a_1,\ldots,a_n\}$ of $\{1,\ldots,N\}$ satisfies $a_i+a_j \neq a_k$ for all $i,j,k$ ($1 \leq i,j,k \leq n$).
Among such $\{a_i\}$, construct one with the maximum $n$.

Input

$N$

$1\leq N \leq 10^5$

Output

$a_1$ $a_2$ $\ldots$ $a_n$
Output $\{a_i\}$ with the maximum $n$. If there are multiple possible constructions, any of them will be accepted.

Sample

Sample 1
Input
1
Output
1

Sample 2
Input
2
Output
1

$\{1,2\}$ is invalid because $1+1=2$.

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