eolymp
bolt
Try our new interface for solving problems
Problems

Beautiful Array

Beautiful Array

Consider the array $a_i~(i = 0, 1 ... n - 1)$ of length $n$, consisting of positive integers, \textbf{beautiful}, if for any $i~(1 \le i \le n)$ decimal representations of $a_i$ and $i$ does not have common digits (for example, if $i = 2022$, then $a_i$ can be equal $19$, but it cannot be equal $303$, because the zero can be found in both $303$ and $2002$). For given $n$ check if exists the beautiful array of length $n$. \InputFile Contains one integer $n~(1 \le n \le 10^{18})$ --- the length of the array. \OutputFile Print $1$, if exists the beautiful array of length $n$, and $0$ otherwise.
Time limit 1 second
Memory limit 128 MiB
Input example #1
3
Output example #1
1
Source 2022 Azerbaijan ICPC Qualification