7562

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

180131_7562_나이트의 이동

//https://www.acmicpc.net/problem/7562#include #include using namespace std;int map[300][300];int sy,sx,dy,dx, I; int diry[8]={2,2,1,1,-1,-1,-2,-2};int dirx[8]={-1,1,-2,2,-2,2,-1,1}; void bfs(int starty, int startx){ queue q; q.push(starty*1000+startx); map[starty][startx]=1; bool chk=1; while(chk && !q.empty()){ int nowy=q.front()/1000; int nowx=q.front()%1000; q.pop(); for(int i=0; i=0 && next..

bong sue
'7562' 태그의 글 목록