vector<int> path(1, 0);
creates a vector of integers which is initially filled with 1 element that has the value 0.vector<bool> path(true,n);
looks like it has the arguments passed in the wrong order. The first argument is supposed to be the number of elements and the second argument the value of the elements.