3190

알고리즘 문제 풀이/1DP_과제(~180615)

180408_3190_뱀

//https://www.acmicpc.net/problem/3190 #include #include #include using namespace std;int N, K, L; int map[100][100]; //머리의 방향#define UP 0#define RIGHT 1#define DOWN 2#define LEFT 3//머리의 방향에 따른 다음 이동 방향//UP일 때, ny=y+dy[0], nx=x+dx[0]...int dy[4]={-1,0,1,0};int dx[4]={0,1,0,-1}; //뱀 몸통은 큐를 이용//사과를 먹지않으면 꼬리(=front, 제일 처음 집어넣은 값) pop//매초 이동시에 머리(=back, 제일 마지막에 집어넣은 값) pushqueue snake; int main(){ c..

bong sue
'3190' 태그의 글 목록