백준 기출 연산자 끼워넣기
/*depth 개념을 넣어야, 다른 값들이 저장되어 있습니다.*/ #include using namespace std; int n, numArr[101], oper[4];long long maxVal = -100000000, minVal = 1000000000; void dfs(int a, int b, int c, int d, int depth, long long sum) {if (depth == n - 1) {if (maxVal sum) minVal = sum;} if (a > 0) {dfs(a - 1, b, c, d, depth + 1, sum + numArr[depth + 1]);}if (b > 0) {dfs(a, b-1, c, d, dep..
2018. 2. 6.
백준 미로탈출
/*미로 탐색*/ #include #include #include using namespace std; int n, m;bool map[100][100];int check[100][100];int dir[4][2] = { {1,0}, {-1,0}, {0,1}, {0,-1} }; struct points {int x, y;}; void problemIn() {cin >> n >> m;for (int i = 0; i < n; i++) {for (int j = 0; j < m; j++) {int b;scanf("%1d", &b);if (b == 1) {map[i][j] = true;}}}} int bfs() {int cur_y = 0;int cur_x = 0; queue que;que.push({ cur_x,..
2018. 2. 1.