Professional Documents
Culture Documents
h>
using namespace std;
// Check whether the given state is valid state or not according to given
constraints
bool is_valid_state(int state)
{
switch(state)
{
case 6: // goat with wolf
case 5: // goat with cabbage
case 9: // man with cabbage only
case 10: // man with wolf only
case 8: //only man
case 7: // wolf with goat and cabbage
return 0;
default : return 1; // In all other case the state is valid
}
}
int main()
{
set<vector<int>> output;
find_path(output);
print(output);
return 0;
}