[백준] 1707번 이분 그래프
·
백준 문제/그래프
문제: 1707번: 이분 그래프 #include #include #include using namespace std;vector> graph;vector colors;bool BFS(int start) { queue nexts; nexts.push(start); // 일단 시작지점을 1으로 색칠해 colors[start] = 1; while (!nexts.empty()) { int cur = nexts.front(); nexts.pop(); // 야 나랑 붙어있는 애들 돌면서 색칠해줘 // 근데 나랑 붙어있는 애가 나랑 똑같은 색으로 색칠되어있다? ㄷㄷ No 출력해야함 for (int next : graph[cur]..