I am quite weak in DP and Bitmasking concept. I need help to solve this problem https://www.codechef.com/problems/TSHIRTS
Thanks.
№ | Пользователь | Рейтинг |
---|---|---|
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 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
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 |
I am quite weak in DP and Bitmasking concept. I need help to solve this problem https://www.codechef.com/problems/TSHIRTS
Thanks.
Название |
---|
Auto comment: topic has been updated by wadhwasahil (previous revision, new revision, compare).
Look at the editorial it is quiet good. You may want to look at problem : http://www.spoj.com/problems/ASSIGN/
I looked at the editorial . I couldn't understand it completely. Can you provide some help?
I couldn't submit my solution in Codechef because when I click on "Submit", it sends me back to the problem statement like nothing happened.
Well... anyway, what I did was, first make a list of all people that can wear each shirt, then iterate on shirts and try to assign them to unassigned people. So let's have DP[i][m] which means ways to reach a state where I processed the first i shirts and the people in mask m have been assigned a shirt already. The answer will be DP[100][2N - 1].