Simple question:How to write easy-to-implement brute force solutions? Which techniques do you use (like using next_permutation)?
Thank you for all answers:-)
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3839 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3612 |
7 | Geothermal | 3569 |
8 | ecnerwala | 3494 |
9 | Um_nik | 3396 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | Um_nik | 164 |
2 | -is-this-fft- | 162 |
3 | maomao90 | 161 |
4 | atcoder_official | 158 |
4 | cry | 158 |
4 | awoo | 158 |
7 | nor | 155 |
7 | adamant | 155 |
9 | TheScrasse | 153 |
10 | maroonrk | 152 |
Simple question:How to write easy-to-implement brute force solutions? Which techniques do you use (like using next_permutation)?
Thank you for all answers:-)
Название |
---|
In this case : B r u t e f o r c e
Thank do not need ((:
For brute-force I use recursion 90% of the time. If you are brute-forcing something which state can be described by a permutation, then sure — go with next_permutation.
But in general brute-force is not algorithm but an approach so it's hard to give you any real advice that will always work. In general I use backtracking with recursion and that's the most standard approach.