Which algo should be used???? http://acm.timus.ru/problem.aspx?space=1&num=1220 problem is Memory limit exceeded here..
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3803 |
2 | jiangly | 3707 |
3 | Benq | 3627 |
4 | ecnerwala | 3584 |
5 | orzdevinwang | 3573 |
6 | Geothermal | 3569 |
6 | cnnfls_csy | 3569 |
8 | Radewoosh | 3542 |
9 | jqdai0815 | 3532 |
10 | gyh20 | 3447 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | maomao90 | 170 |
2 | awoo | 164 |
3 | adamant | 162 |
4 | maroonrk | 152 |
5 | -is-this-fft- | 151 |
6 | nor | 150 |
7 | atcoder_official | 148 |
7 | SecondThread | 148 |
9 | TheScrasse | 146 |
10 | Petr | 145 |
Which algo should be used???? http://acm.timus.ru/problem.aspx?space=1&num=1220 problem is Memory limit exceeded here..
Название |
---|
I haven't tried to solve it myself. Could you please elaborate more on what's your approach to see if we can point you in the right direction?
I m using stack[1001] stl here, but it shows memory limit exceeded...
stl stack (std::stack) uses too much memory. You should organize your own stack. I used my own linked lists. Eech node of the list contain 0..7 elements.
try to submit under Visual C++ 2010 if you are using G++.
is there any way to solve with standard C++ ??
I got AC half an hour ago with MS VS 2010 C++ compiler. The same code with G++ gets ML.