'완전탐색' 태그의 글 목록 (4 Page)
2021년09월06일_15683-감시
소스코드 #include #include #include #include using namespace std; #define NSIZE 8 #define MSIZE 8 //model int N, M; int board[NSIZE][MSIZE]; int cctvDir[] = { 4,2,4,4,1 }; int dy[] = { 0,1,0,-1 }; int dx[] = { 1,0,-1,0 }; int ret; struct info { int y, x, num; }; vectorCCTV; //act void init(); void dfs(int idx, int cnt); int main(void) { int testCase = 1; for (int tc = 1; tc
2021. 9. 6.
9095 1,2,3 더하기
www.acmicpc.net/problem/9095 9095번: 1, 2, 3 더하기 각 테스트 케이스마다, n을 1, 2, 3의 합으로 나타내는 방법의 수를 출력한다. www.acmicpc.net #include #include #include #include #include #include using namespace std; int N; int n; int ret; void init() { N = n=0; scanf("%d", &N); } void dfs(int idx, int sum) { if (idx > n) return;//범위 넘어가는경우 if (sum > n)return; if (sum == n) { ret++; return; } dfs(idx + 1, sum + 1); dfs(idx + ..
2021. 2. 25.