욕심쟁이 판다

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

180123_1937_욕심쟁이 판다

//https://www.acmicpc.net/problem/1937 #include #include #include using namespace std;int map[502][502];int dp[502][502];int dy[4] = {1,0,-1,0};int dx[4] = {0,1,0,-1}; int n;int mov(int nowy, int nowx){ if(dp[nowy][nowx]==0) { dp[nowy][nowx]=1; int nexty, nextx; for(int i=0; imap[nowy][nowx]) { dp[nowy][nowx]=max(dp[nowy][nowx],mov(nexty,nextx)+1); } } } return dp[nowy][nowx];} int main(){ scanf..

bong sue
'욕심쟁이 판다' 태그의 글 목록