BOJ 1463
[백준 1463번][C++] 1로 만들기
그래프를 만든 후 DFS를 실행하는 간단한 문제입니다 아직 그래프 만드는 방식이 익숙하지 않아 코드를 약간 길게 작성하였습니다ㅠ #include #include using namespace std; #define Not_Visited 0; #define Visited 1; //감염시킨 컴퓨터의 수 int cnt = 0; //각 컴퓨터의 정보를 저장하는 Computer 클래스 class Computer { public: int IsVisited; //방문 여부 int data; //노드 숫자 vector list; //인접한 컴퓨터 저장 Computer(int data) { IsVisited = 0; this->data = data; } ~Computer() {} }; //전체 컴퓨터를 저장하는 리스트 v..