Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Inside Of Me
- 러블리즈
- 기타
- DBMS
- 장범준
- 말 더듬
- 핑거스타일
- nginx
- index
- 오라클
- 데이터베이스
- 봄 사랑 벚꽃 말고
- I'm fine thank you
- 신입
- DBMS 구성요소
- 6학년 8반 1분단
- 니가 참 좋아
- 레이디스코드
- 슬픔의 후에
- IT
- 스위트라떼
- 악보
- 개발자
- 천공의 시간
- SQL 처리
- 인덱스
- 아이유
- 오라클 아키텍처
- db
- oracle
Archives
취미로 음악을 하는 개발자
[C++] 백준 10971. 외판원 순회 2 본문
728x90
#include <iostream >
#include <vector>
#include <algorithm>
int travelCnt(int* arr, int col){ // 비용 계산
}
}
do{ // 모든 경로의 경우의 수에 다시 처음 지점으로 되돌아 오는 도시를 추가한 순열
}
index++;
} while ( next_permutation( v. begin( ), v. end( )));
}
sum += travelCnt(W[arr[i][j]], arr[i][j+1]);
else { // 경로 중에 0이 있으면 갈 수 없다!
isZero = true;
break;
}
}
if (isZero) {
sum = 0;
isZero = false;
continue;
}
else {
cost[i] = sum;
if (min > sum)
min = sum;
}
sum = 0;
}
cout << min << endl;
}
'공대인 > Nojam' 카테고리의 다른 글
[C++] 백준 11653. 소인수분해 (0) | 2019.04.23 |
---|---|
[C++] 백준 1934. 최소공배수 (0) | 2019.04.23 |
[C++] 백준 11022. A+B -8 (0) | 2019.04.17 |
[C++] 백준 11021. A+B -7 (0) | 2019.04.17 |
[C++] 백준 2163. 초콜릿 자르기 (0) | 2019.04.17 |
Comments