No.192 Composite Number
レベル :
/ AI推定難易度 : 115
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 256 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : / 解いたユーザー数 681
作問者 :
evima
タグ : / 解いたユーザー数 681
作問者 :
evima
問題文最終更新日: 2026-06-25 06:24:58
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 open 2015 small
(順位表)
の他の問題:
Problem Statement
You are given an integer $N$. Find $1$ composite number between $N - 100$ and $N + 100$, inclusive.
Here, a composite number is a positive integer that has a positive divisor other than $1$ and itself.
Input
N
$101 \le N \le 1000$
Output
Output $1$ composite number between $N - 100$ and $N + 100$, inclusive (leading and trailing whitespace is ignored).
It can be shown that such a number exists for any $N$ satisfying the input constraints.
Sample
Sample 1
Input
101
Output
4
None of $1, 2, 3$ is a composite number, but $4$ is a composite number since it has $2$ as a divisor in addition to $1, 4$.
Sample 2
Input
1000
Output
1000
If $N$ itself is a composite number, outputting it is also accepted as correct.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。