'알고리즘' 태그의 글 목록 (32 Page)
본문 바로가기
728x90
반응형

알고리즘250

치킨 배달 www.acmicpc.net/problem/15686 15686번: 치킨 배달 크기가 N×N인 도시가 있다. 도시는 1×1크기의 칸으로 나누어져 있다. 도시의 각 칸은 빈 칸, 치킨집, 집 중 하나이다. 도시의 칸은 (r, c)와 같은 형태로 나타내고, r행 c열 또는 위에서부터 r번째 칸 www.acmicpc.net #include #include #include #include #include using namespace std; #define NS 51 //배열의 최대 크기 int N, M;//배열 크기, 뽑는 치킨집 수 int ret; //결과값 저장 변수 int B[NS][NS]; struct Data { int y, x; };//좌표 구조체 vectorC;//치킨집의 정보 vectorH;//집.. 2020. 10. 13.
아기상어 www.acmicpc.net/problem/16236 16236번: 아기 상어 N×N 크기의 공간에 물고기 M마리와 아기 상어 1마리가 있다. 공간은 1×1 크기의 정사각형 칸으로 나누어져 있다. 한 칸에는 물고기가 최대 1마리 존재한다. 아기 상어와 물고기는 모두 크기를 가�� www.acmicpc.net #include #include #include #include #include #include using namespace std; #define NS 21 int N;//바다의 크기 int sea[NS][NS];//초기 입력 배열 바다 정보 int ret;//결과값 int dy1[4] = { 0,1,0,-1 }; int dx1[4] = { 1,0,-1,0 }; struct Data { int y,.. 2020. 10. 13.
www.acmicpc.net/problem/3190 3190번: 뱀 'Dummy' 라는 도스게임이 있다. 이 게임에는 뱀이 나와서 기어다니는데, 사과를 먹으면 뱀 길이가 늘어난다. 뱀이 이리저리 기어다니다가 벽 또는 자기자신의 몸과 부딪히면 게임이 끝난다. 게임 www.acmicpc.net #include #include #include #include #include using namespace std; #define NS 101//배열의 최대 크기 int N, K, L;//배열크기, 사과 개수, 경로개수 int ret;//결과값 int map[NS][NS];//뱀의 경로 배열 int dy[] = { 0,1,0,-1 }; int dx[] = { 1,0,-1,0 }; void init_input() {/.. 2020. 10. 13.
드래곤 커브 www.acmicpc.net/problem/15685 15685번: 드래곤 커브 첫째 줄에 드래곤 커브의 개수 N(1 ≤ N ≤ 20)이 주어진다. 둘째 줄부터 N개의 줄에는 드래곤 커브의 정보가 주어진다. 드래곤 커브의 정보는 네 정수 x, y, d, g로 이루어져 있다. x와 y는 드래곤 커� www.acmicpc.net #include #include #include #include using namespace std; #define NS 101//배열 최대 크기 int N;//배열의 크기 int ret;//결과 값 int map[NS][NS];//드래곤 커브 확인 배열 int dy[] = { 0,-1,0,1 }; int dx[] = { 1,0,-1,0 }; struct Data { int y, x.. 2020. 10. 13.
728x90
반응형