Can anybody help me with this problem Perfect Cakes.This problem was asked in Directi recruitment challenge.
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
Can anybody help me with this problem Perfect Cakes.This problem was asked in Directi recruitment challenge.
Название |
---|
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.