Can anybody help me with this problem Perfect Cakes.This problem was asked in Directi recruitment challenge.
# | 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 |
Can anybody help me with this problem Perfect Cakes.This problem was asked in Directi recruitment challenge.
Name |
---|
This is the same problem as UVA 665 which by the way is a problem from NEERC 1998 (tests there aren't really that strong, though model solution is correct).
Since the sample cake has different mass than the others, imagine first that it has lower mass. Then perform all checks and mark the possibility for the cakes (for instance, if you have a < comparison, you mark the cakes on the left side as possible ones to be the different one in case you know nothing about them, and all the others, including those not in the comparison, as surely not being the sample cake).
Do the same if it had bigger mass and compare the solutions, either they point to the same cake or one gives an invalid solution and the other a unique solution. This is necessary since we only knew the cake had different mass than the others.