백준 17779 게리맨더링2
https://www.acmicpc.net/problem/17779 소스가 많이 별로지만.... #define _CRT_SECURE_NO_WARNINGS #include #include #include using namespace std; int N, map[21][21], area[21][21]; int arr[6]; int res = 987654321; int dy[4] = { -1,1,1,-1 }; int dx[4] = { 1,1,-1,-1 }; void solve(int x, int y, int d1, int d2) { ////5번선거구(경계선만) int nx = x, ny = y; area[x][y] = 5; int dir = 0; for (int z = 0; z < 2; z++) { for (..
2020. 3. 4.