'dfs' 태그의 글 목록 (3 Page)
2021.09.14_14500-테트로미노
시간초과 소스 #include #include #include #include using namespace std; #define NS 1004 #define MS 1004 int N, M;//보드 입력으로 주는 가로 세로 int maxAnswer;//최대 결과값 저장 int board[NS][MS];// 테트로미노 놓는 보드 int arr[NS][MS];// 테트로미노 그리는 보드 int dy[] = { 0,1,0,-1 }; int dx[] = { 1,0,-1,0 }; char ah[4][3][3] = { { {1,1,1}, {0,1,0}, {0,0,0} }, { {0,1,0}, {1,1,0}, {0,1,0} }, { {0,1,0}, {1,1,1}, {0,0,0} }, { {0,1,0}, {0,1,1}..
2021. 9. 14.
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.
13460_구슬탈출2
#include #include #include #include #include #define NMSIZE 11 using namespace std; char board[NMSIZE][NMSIZE];// 구슬과 구멍 맵그려지는 곳 int chk[NMSIZE][NMSIZE][NMSIZE][NMSIZE];// 구슬 위치 체크하는 배열 int N, M;//가로 세로 크기입력 변수 int ret;//결과값 저장 int dy[] = { 0,1,0,-1 };// 상하좌우 이동 위한 배열 int dx[] = { 1,0,-1,0 }; void init();//초기화 void play();//시뮬레이션 시작 struct ballXY { int ry, rx;//빨간공 y,x int by, bx;//파란공 y,x int c..
2021. 9. 1.