Hi, can you give me some set of recursion-based problems (brute-force or anything similar) ?
# | 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 | 151 |
Hi, can you give me some set of recursion-based problems (brute-force or anything similar) ?
Name |
---|
I don't think there's anything like 'recursion based problems'. Recursion isn't very advisable method of solving the problems because its implementation is inefficient. As each function call uses some memory, it may eventually lead to the stack overflow problem. Of course, recursion may be a very good way to simplify the algorithm what surely helps you to understand how it works (and why it's correct). It also makes an implementation easier what's valuable during the contest. But anyway, there always exists some (better) solution which doesn't use recursion. A good example is DP. You can write top-down DP which is usually more obvious and shorter but there's always some bottom-up DP which is more efficient. Though if you think you need some training in recursion, you can take any DP problem as it has two ways of solving: bottom-up and top-down (with recursion).
How about backtracking problems?
Good example. Backtracking problems are these in which recursion is usually used. Although it's the best way of solving during the contest (because of time), it doesn't mean other ones don't exist. Each call of recursive function have some initial set of values which outline the state in which we are. We can always pack this set of values into one object and make a stack of this objects. It's how we can avoid using recursion. Usually it's even simpler as we can do it by several nested loops. I think we can distinguish two types of recursion. 1)programming recursion — when we really call a function in itself. It can be always avoided. 2)algorithmic recursion — when we have recursive algorithm, then this recursion exists in our way of thinking, regardless its later implementation. We can often find recursion algorithms in DP and (as you've mentioned) backtracking.
Na to sam mislio :D
In that case, you can read about it in CP3 and try solving UVa problems.
Search for problems with the tag "divide and conquer" its the modern term for recursion. https://mirror.codeforces.com/problemset?tags=divide+and+conquer