728x90 반응형 156852 2021.09.16_15685-드래곤커브 소스코드 #include #include #include #include using namespace std; #define MAX_SIZE 104 int board[MAX_SIZE][MAX_SIZE]; int dy[] = { 0,-1,0,1 }; int dx[] = { 1,0,-1,0 }; int N; int answer; void init();// 초기화 void dragon();//드래곤 커브 int main(void) { int testCase = 1; for (int tc = 1; tc =0; dir_idx--) { dir.push_back((dir[dir_idx]+1) % 4); } } board[y][x] = 1; for (int dir_idx = 0; dir_idx < dir.size();.. 2021. 9. 16. 15685 드래곤 커브 https://www.acmicpc.net/problem/15685 15685번: 드래곤 커브 첫째 줄에 드래곤 커브의 개수 N(1 ≤ N ≤ 20)이 주어진다. 둘째 줄부터 N개의 줄에는 드래곤 커브의 정보가 주어진다. 드래곤 커브의 정보는 네 정수 x, y, d, g로 이루어져 있다. x와 y는 드래곤 커� www.acmicpc.net #include #include #include #include #include using namespace std; #define MAP_SIZE 101 int N; int map[MAP_SIZE+4][MAP_SIZE+4]; int dy[] = { 0,-1,0,1 }; int dx[] = { 1,0,-1,0 }; struct Data { int y, x, dir, a.. 2020. 7. 25. 이전 1 다음 728x90 반응형