https://codeforces.net/contest/1366/submission/83422255 In today's contest i was trying to solve a problem and i got re. Can anyone explain why?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
https://codeforces.net/contest/1366/submission/83422255 In today's contest i was trying to solve a problem and i got re. Can anyone explain why?
Название |
---|
It is really obvious from your memory consumption. It is a stack overflow. Imagine how many recursive calls you will do? Don't you think it is too much? I will give you a hint:
Imagine a stick is $$$X$$$ and a diamond is $$$Y$$$. You will need to minimize the sum of $$$X$$$ and $$$Y$$$ after you simultaneous subtract them. There are two methods of subtraction which will give you an emerald:
$$$X=X-1$$$,$$$Y=Y-2$$$
or
$$$X=X-2$$$,$$$Y=Y-1$$$
thanks
You're welcome!