반응형 [PCCP] Lv2: 게임 맵 최단거리(1844) 해설 문제- 문제 링크: 게임 맵 최단거리 해설- 자료구조: - 시간복잡도: (풀이과정)1) 2) 3) 4) 코드(C언어)solution 1)더보기solution 1#includesolution 2)더보기#includesolution 3)더보기#include (C++)solution 1)- N*N: 배열의 크기- 너비우선탐색은 모든 노드를 한 번씩 확인하므로 최종 시간 복잡도는 O(N*M)더보기#include #include using namespace std;const int MAX_SIZE = 100;const int dx[4] = {-1, 0, 1, 0};const int dy[4] = {0, 1, 0, -1};int check[MAX_SIZE][MAX_SIZE];// 좌표 정보 및 좌표 연산을 하기.. 2024. 12. 25. 이전 1 다음 반응형