백준 : 14888
https://www.acmicpc.net/problem/14888 14888번: 연산자 끼워넣기 첫째 줄에 수의 개수 N(2 ≤ N ≤ 11)가 주어진다. 둘째 줄에는 A1, A2, ..., AN이 주어진다. (1 ≤ Ai ≤ 100) 셋째 줄에는 합이 N-1인 4개의 정수가 주어지는데, 차례대로 덧셈(+)의 개수, 뺄셈(-)의 개수, 곱셈(×)의 개수, 나눗셈(÷)의 개수이다. www.acmicpc.net #include #include #include #include #include using namespace std; int N; int A[101]; char Ope_c[4] = { '+','-','*','/' }; int Ope[4] = { 0, }; int Max = -987654321; in..
백준 : 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