Hello Codeforces, I came across an interesting error while solving this problem : https://codeforces.net/contest/1950/problem/G which I am not able to understand as to why this is happening?
https://codeforces.net/contest/1950/submission/255101098 (This solution did not get accepted but gave runtime error) https://codeforces.net/contest/1950/submission/255101528 (This solution got accepted)
Note there is very little difference between the two
In the first solution I have initialized vector as : vector<vector<int>>dp(n,vector<int>((1<<n),-1));
In the second solution I have initialized vector as : vector<vector<int>>dp((1<<n),vector<int>(n,-1));
I really don't understand what is causing this error. Any help would be appreciated. Thank you !