'알고리즘 모음집' 카테고리의 글 목록 (29 Page)
2021년09월02일_3190-뱀
#include #include #include using namespace std; #define SIZE 101 // 보드의 최대 크기 int N, K, L;//입력으로 주어지는 보드크기,사과의 개수, 뱀의 방향 변환 횟수 int board[SIZE][SIZE]; int dy[] = { 0,1,0,-1 };//방향 int dx[] = { 1,0,-1,0 }; void init(); void play();//게임 시작 struct info { int y, x, size, dir; }snake; int main(void) { int testCase = 1; for (int tc = 1; tc
2021. 9. 2.
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.