백준 : 14889
https://www.acmicpc.net/problem/14889 14889번: 스타트와 링크 예제 2의 경우에 (1, 3, 6), (2, 4, 5)로 팀을 나누면 되고, 예제 3의 경우에는 (1, 2, 4, 5), (3, 6, 7, 8)로 팀을 나누면 된다. www.acmicpc.net #include #include #include #define INF 987654321; using namespace std; int N; bool team[1001]; int S[1001][1001]; int Min = INF; void DFS(int cur,int cnt) { if (cnt == N / 2) { vector link; vector star; for (int i = 1;i N; for (int i =..
백준 : 1931*
https://www.acmicpc.net/problem/1931 1931번: 회의실배정 (1,4), (5,7), (8,11), (12,14) 를 이용할 수 있다. www.acmicpc.net #include #include using namespace std; int N; pair p[100001]; bool compare(pair &p1,pair &p2){ if(p1.second == p2.second) return p1.first N; for(int i=0;i>p[i].first>>p[i].second; } sort(p,p+N,compare); int cnt=0; int locate=0; for(int i=0;i