Hi, I have no idea how to solve this problem. can anyone help me?
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 151 |
Hi, I have no idea how to solve this problem. can anyone help me?
Name |
---|
Every positive number can be represented as a form like this: 2^x * 3^y * z, where z is not divisible by 2 and 3.
Let's suppose that n = 2^x * 3^y * z. Then we cannot have 2n = 2^(x+1) * 3^y * z and 3n = 2^x * 3^(y+1) * z in set S.
Now, let's define a plane P[z]. For each number 2^x * 3^y * z, draw a point in P[z]. Then, the problem will be solvable :)
Sorry for the poor English.
We can have 2n and 3n in set S if we didn't include n in set S.
can you code your idea please to make me understand your idea very well.
Sorry for my mistake..
Let's suppose that
n = 2^x * 3^y * z
. (wherez
is not divisible by 2 and 3) If we includen
in setS
, we cannot have2n = 2^(x+1) * 3^y * z
and3n = 2^x * 3^(y+1) * z
in setS
.Let's define a plane
P[z]
wherez
is not divisible by 2 and 3. For each positive integeri = 2^x * 3^y * z (<= N)
, draw a point(x, y)
atP[z]
.If we select the point
(x, y)
inP[z]
, then we cannot select the point(x+1, y)
and(x, y+1)
inP[z]
. So the problem is: how many ways can we choose points such that the condition above is satisfied?The value of
x
andy
are very small, so we can do this in DP.Good idea, but how to do this in DP effectively, notice that we have n/3 numbers less than n that not divisible by 2 and 3 and we have 500 test cases per input.
You can use bitmasks.. It needs more complex solution than just bitmasking. Think about it :)