No.1114 Addition Spilled Is Not Returned to the Tray
問題文最終更新日: 2020-08-22 17:25:00
English (AI translation)
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$
Sample
Sample 1
Input
1
Output
1
Sample 2
Input
2
Output
1
$\{1,2\}$ is invalid because $1+1=2$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
37zigen
Kiri8128