Hello codeforces!
I need help with this problem: UVa_11754
If all Ki = 1, we can use Chinese Remainder Theorem directly, but the number of possible states is (Π Ki = 100^9)
I believe there is a brute_force solution but i couldn't find it ):
# | 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 | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Hello codeforces!
I need help with this problem: UVa_11754
If all Ki = 1, we can use Chinese Remainder Theorem directly, but the number of possible states is (Π Ki = 100^9)
I believe there is a brute_force solution but i couldn't find it ):
Name |
---|
Auto comment: topic has been updated by Ismail_Alrifai (previous revision, new revision, compare).
The number of possible states should actually be bounded by $$$2^{32}$$$ as the problem statement guarantees that the product of $$$X$$$s fit into a 32-bit integer. That said, I believe you should be able to partition the congruences into two disjoint sets (of roughly equal number of states, so upper bounded by $$$2^{18}$$$) and generate all possible solutions in each set and use some kind of meet in the middle technique.
But the Ki <= 100, i meant in "possible state" as all combinations of Yij, try all Yij from each clue so the total 100 ^ 9.
if i missed some thing can you please explain how (possible states should actually be bounded by 2^32)
thank you :)
k is less than x and they say "the product of the X’s will fit into a 32-bit integer"
Right, I missed that.
well done Hosen <3
it can be solved by two ways: enum the x and test whether it fits the conditions. dfs search all remainder and use chinese remainder.
luckily, there is a code by RuJia.
i will check the code, thank you