error : terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc;
why my code gives this bad_alloc error ,even though have allocated enough memory? i’m not able to figure it out. what mistake am i doing in the following code. void dfs(ll root , vector<vector<ll>> graph , vector<ll>a , ll wt , ll &ans) { for(auto it : graph[root]) { ans = max(ans , (wt -… Read More error : terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc;