Hi everyone! when I try to solve a problem using treap of size 100000, I use something like
struct node { ... node * ch[2]; }
and I keep MLE (see http://codeforces.me/contest/431/submission/6702556)
... and when I switch the language to C++0x, I got AC ( see http://codeforces.me/contest/431/submission/6702604)
so I got confused about differences of those two language. Can anyone explain it to me ? Thank you in advance!
The difference is in randseed. I've submitted the second code under GNU C++ and it got AC as well.
But how can rand seed effect the memory ? ...
Your tree structure depends on randseed. For example, there could be some loop in the tree which lead to stack overflow.