2644

알고리즘 문제 풀이/1DP_과제(~180615)

180131_2644_촌수계산

//https://www.acmicpc.net/problem/2644 #include #include #include using namespace std;int parent[101]; // parent[i] :: i의 부모int chon[101];int n; void bfs(int start){ queue q; q.push(start); chon[start]=0; while(!q.empty()) { int now=q.front(); q.pop(); for(int i=1; i> n >> a >> b >> m; for(int i=0; i> x >> y; parent[y]=x;//y의 부모가 x } memset(chon, -1, sizeof(chon)); bfs(a); cout

bong sue
'2644' 태그의 글 목록