shashankagrawal's blog

By shashankagrawal, history, 4 years ago, In English

We can change stack size in linux temporarily by using the command ulimit -s new_value, But is there any way to change stack size permanently, or Can we do something within C++ code, so it will change stack size by itself?

I tried changing this, but It didn't work. I faced this issue in hackercup qualification round D2, terminal gave segfault, and later I came to know about the low value of default stack size in linux.

Full text and comments »

  • Vote: I like it
  • +81
  • Vote: I do not like it

By shashankagrawal, history, 4 years ago, In English

Can any one help me with why this solution is getting TLE, are the constants too high? My solution is here in which I made single segment tree for whole of the tree And the one which got AC, in which I made different segtree for each heavy path, is here

Edit :- Got it now, Thanks to jef

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it