171108_원재의 벽 꾸미기
#include using namespace std; int main() { int T; scanf("%d", &T); for (int tc = 1; tc
#include using namespace std; int main() { int T; scanf("%d", &T); for (int tc = 1; tc
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071#include #include #include using namespace std; int code[4000]; void Insert(int x, int y, int length_code){ for(int i=length_code-1; i>=x; i--) code[i+y]=code[i]; for(int i=x; i> code[i]; length_code+=y;}void Delete(int x, int y, int length_code){ for(int i=x; i co..
#include #include using namespace std;void upheap(int index);int downheap(int index, int node);void heap_sort(int node);void swap(int *a, int *b); int arr[100000];void swap(int *a, int *b){int tmp = *a;*a = *b;*b = tmp;}void heap_sort(int node){arr[0] = arr[node];arr[node] = NULL;if (node > 2) {int tmp = 0;downheap(tmp, node);}else //node==2if (arr[0] < arr[1]) swap(&arr[0], &arr[1]);}int downhe..
12345678910111213141516171819202122232425262728293031#include using namespace std; int main(){ for (int T = 1; T