No.3383 1122-like Number (C++)
タグ : / 解いたユーザー数 10
作問者 :
Rho
Problem Statement
A positive integer that can be expressed as the product of $4$ distinct primes is called a 1122-like number.
For example, $1122=2\times 3\times 11\times 17$ and $210=2\times 3\times 5\times 7$ are 1122-like numbers, while $12=2^2\times 3$ and $81=3^4$ are not 1122-like numbers.
Given an integer $N$, find the number of 1122-like numbers less than or equal to $N$.
Input
$N$
- $1 \leq N \leq 3.5\times 10^6$
- All inputs are integers.
Output
Print a newline at the end.
Score
Intended solution: $137$ bytes
Score formula
When the code length of a submitted source code is $x$ and the code length of the intended solution for this problem is $y$, the score of that source code is calculated as follows.- If $y\leq x$: $\lfloor100\exp(-0.012(x-y))\rfloor$ points
- If $x<y$: $101$ points
Sample
Sample 1
Input
500
Output
4
There are $4$ 1122-like numbers less than or equal to $500$: $210, 330, 390, 462$.
Sample 2
Input
1122
Output
18
Sample 3
Input
3000000
Output
305541
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。