[C++] 백준 2250 트리의 높이와 너비
·
Algorithm/Baekjoon
#include #include #include #include using namespace std; const int MaxNode = 10001; int x = 1, maxY = 0; pair nodes[MaxNode];//노드들을 받아온다. vector pos[MaxNode];//노드들의 위치를 저장한다. bool visited[MaxNode];//노드를 갔나의 표시 void MidCycle(int y, int curr); int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, m, level = 1, length = 1; cin >> n; for (int i = 0; i < n; i++) { int temp1, temp2, temp3; cin..