백준 24060 병합 정렬
#include #include using namespace std;int n, m;int countAnswer = 0;int answer = 0;void merge(vector&, int, int, int);void merge_sort(vector& arr, int start, int end){ if (start & arr, int start, int mid, int end){ int i = start; int j = mid + 1; int t = 0; int size = end - start + 1; vector temp(size); while (i > n >> m; vector arr(n); for (int i = 0; i > arr[i]; } merge_sort(arr, 0, arr.size() ..
백준 17829 - 222풀링
쿼드트리로 2*2 행렬을 계속해서 만들자 #include #include #include #include int n;using namespace std;int Recursion(int x, int y, int len, vector>& vec){ // 마지막 2*2 정사각형을 만들기 위해 if (len == 1) { return vec[x][y]; } vector v; int divsize = len / 2; v.push_back(Recursion(x, y, divsize, vec)); v.push_back(Recursion(x, y + divsize, divsize, vec)); v.push_back(Recursion(x + divsize, y, divsize, vec)); v.push_back(Rec..