일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- swexpertacademy
- 코테
- BFS
- dfs
- 완전탐색
- 프로그래머스
- 삼성
- 알고리즘
- MySQL
- 코테 대비
- sw expert academy
- nightroutine
- readingbook
- 원서
- 백준
- 원서읽자
- SQL
- 코테 준비
- STUDYENGLISH
- sw expert
- 원서읽기
- 직무면접
- 코딩테스트
- englishbook
- PyQt
- the midnight library
- 쉬운 알고리즘 문제
- 알고리즘 문제
- D4
- English
- Today
- Total
목록전체 탐색 (2)
시나브로
먼저 white로 시작하는 체스판과 black으로 시작하는 체스판을 만들어 놓고 비교한다 모든 점을 시작점으로 하는 완전 탐색을 해서 최솟값을 찾았다. #include #include #include #include using namespace std; int main(void) { freopen("inp.inp", "r", stdin); freopen("out.out", "w", stdout); int white[50][50] = { 0 }; int black[50][50] = { 0 }; int board[50][50] = { 0 }; bool signal = 0; int n = 0, m = 0; scanf("%d %d", &n, &m); for (int i = 0; i < n; i++) { for ..
전체탐색으로 풀면 된다. #include #include #include #include using namespace std; int main(void) { freopen("inp.inp", "r", stdin); freopen("out.out", "w", stdout); int n = 0; scanf("%d", &n); int list[55][2] = { 0 }; for (int i = 0; i < n; i++) { scanf("%d %d", &list[i][0], &list[i][1]); } for (int i = 0; i < n; i++) { int count = 1; for (int j = 0; j < n; j++) { if (i == j) continue; if (list[i][0] < list..