Hi, I have no idea how to solve this problem. can anyone help me?
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3611 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | Radewoosh | 3415 |
| 8 | Um_nik | 3376 |
| 9 | maroonrk | 3361 |
| 10 | XVIII | 3345 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 162 |
| 2 | adamant | 148 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 143 |
| 5 | errorgorn | 141 |
| 6 | cry | 138 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 10 | soullless | 133 |
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. (wherezis not divisible by 2 and 3) If we includenin setS, we cannot have2n = 2^(x+1) * 3^y * zand3n = 2^x * 3^(y+1) * zin setS.Let's define a plane
P[z]wherezis 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
xandyare 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 :)