[WinAPI] 도형 그리기, 마우스 좌표
case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = BeginPaint(hWnd, &ps); //출력하기 위한 도구 //텍스트 출력 (x좌표,y좌표,텍스트,크기) TextOut(hdc, 50, 50, TEXT("win32"), 5); //사각형 출력 (왼쪽위좌표,오른쪽아래좌표) Rectangle(hdc, 100, 100, 200, 200); //원 출력 (왼쪽위좌표,오른쪽아래좌표) Ellipse(hdc, 100, 100, 200, 200); //선 그리기 MoveToEx(hdc, 300, 100, NULL); //시작좌표 LineTo(hdc, 400, 150); //끝좌표 MoveToEx(hdc, 100, 400, NULL);//다른 선을 그릴 때마다 시작좌표 새로 설정해야 함 ..
[백준] 2630번 - 분할 정복 알고리즘
#include using namespace std; int n; int** ar; int blue= 0,white = 0; void ColorPaper(int x, int maxX, int y, int maxY) { bool re = false; int init = ar[y][x]; for (int i = y; i < maxY ; i++) { for (int j = x; j < maxX; j++) { if (ar[i][j] != init) re = true; } } if (re) { int size = maxX - x; ColorPaper(x, x + size / 2, y, y + size / 2); ColorPaper(x + size / 2, x + size, y, y + size / 2); Colo..