#include #include #include #include using namespace std; int n, k; int sec=0;//가장빠른시간을 저장할 변수 bool visited[100001];//방문여부를 저장할 배열 int cnt = 0;//빠른시간으로 동생을 찾는 방법의 개수 void bfs() { queueq;//queue 선언 pair의 first는 현재위치, second는 이동에따른 시간을 저장 q.push(make_pair(n, 0));//시작위치와 0초를 push visited[n] = true;//방문표시 while (!q.empty()) { int a = q.front().first;//queue의 front값을 저장 int b = q.front().second; q.pop..