'SW 알고리즘' 태그의 글 목록 (2 Page)
드래곤 커브
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.
로봇 청소기
www.acmicpc.net/problem/14503 14503번: 로봇 청소기 로봇 청소기가 주어졌을 때, 청소하는 영역의 개수를 구하는 프로그램을 작성하시오. 로봇 청소기가 있는 장소는 N×M 크기의 직사각형으로 나타낼 수 있으며, 1×1크기의 정사각형 칸으로 나누어 www.acmicpc.net #include #include #include #include using namespace std; #define NMSIZE 50 //세로와 가로의 최대 크기 int N, M;//세로크기, 가로크기 int ret;//최종값 결과값 int rY, rX, rDir;//로봇의 현재 위치와 방향 int square[NMSIZE][NMSIZE];//초기 입력배열 int dy[] = { -1,0,1,0 };//북, ..
2020. 10. 11.