[백준 10971번] 외판원 순회 2 (C++)
문제링크 : https://www.acmicpc.net/problem/10971#include using namespace std;typedef long long ll;int n, answer = INT_MAX, start;int arr[11][11];bool visited[11];void dfs(int idx, int cost, int depth){ if(depth==n-1) //최대 깊이 도달 { if(arr[idx][start]) { answer = min(answer, cost + arr[idx][start]); return; } } for(int i=0; i> n; for(int i=0; i>..
백준/실버
2025. 3. 8. 17:49