I usually write: ↵
↵
'#define N 1000000↵
↵
vector<int> adj[N];↵
↵
But when I run it locally, I get segmentation fault due to stack size being too small, so I end up reducing N to something like 10000 and forget to change it back again before submitting, causing unnecessary penalties. ↵
↵
↵
↵
So is there anyway to permanently increase stack size in ubuntu?↵
↵
g++ -Wl,--stack=268435456 file.cpp works in Windows.↵
↵
ulimit -s unlimited only increases stack size for the specific terminal ↵
↵
UPD:↵
↵
Thanks a lot for your replies, I ended up spilling water on my laptop :(↵
↵
I'll try the suggestions when (if?) My laptop gets dried.
↵
'#define N 1000000↵
↵
vector<int> adj[N];↵
↵
But when I run it locally, I get segmentation fault due to stack size being too small, so I end up reducing N to something like 10000 and forget to change it back again before submitting, causing unnecessary penalties. ↵
↵
↵
↵
So is there anyway to permanently increase stack size in ubuntu?↵
↵
g++ -Wl,--stack=268435456 file.cpp works in Windows.↵
↵
ulimit -s unlimited only increases stack size for the specific terminal ↵
↵
UPD:↵
↵
Thanks a lot for your replies, I ended up spilling water on my laptop :(↵
↵
I'll try the suggestions when (if?) My laptop gets dried.