'재귀' 태그의 글 목록
본문 바로가기
728x90
반응형

재귀33

2021.10.24_golang-15686-치킨배달 소스코드 | golang package main import ( "bufio" "fmt" "os" ) type Data struct { y, x int } var ( n, m int answer = 0 board = [51][51]int{} reader *bufio.Reader = bufio.NewReader(os.Stdin) writer *bufio.Writer = bufio.NewWriter(os.Stdout) chicken []Data home []Data D [15]int ) func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) } func scanf(f string, a ...interface{}) { fmt.Fscanf(.. 2021. 10. 24.
2021.09.23_17141-연구소2_17142-연구소3 소스코드 | 17141 #include #include #include #include #include #include using namespace std; #define SIZE 51 int N, M;// 배열크기, 바이러스 선택 int answer;//결과값 int lab[SIZE][SIZE];//바이러스 상태 표시 int dy[] = { 0,1,0,-1 }; int dx[] = { 1,0,-1,0 }; struct Data { int y, x, cnt; }; vectorv; void init();//초기화 void dfs(Data c); bool safeZone(int y, int x);//범위 체크 int main(void) { int testCase = 1; for (int tc = 1; tc 2021. 9. 23.
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.
16234 인구이동 https://www.acmicpc.net/problem/16234 16234번: 인구 이동 N×N크기의 땅이 있고, 땅은 1×1개의 칸으로 나누어져 있다. 각각의 땅에는 나라가 하나씩 존재하며, r행 c열에 있는 나라에는 A[r][c]명이 살고 있다. 인접한 나라 사이에는 국경선이 존재한다. 모�� www.acmicpc.net #include #include #include #include #include using namespace std; #define N_SIZE 51 int N, L, R;// 배열의 크기, 최소, 최대 수 int ret;//결과값 저장 int humanMap[N_SIZE][N_SIZE];// 인구수 저장 배열 int dy[4] = { 0,1,0,-1 }; int dx[4] = .. 2020. 8. 18.
728x90
반응형