1520번

· 백준
코드#include #include using namespace std;const int dx[] = {1,-1,0,0};const int dy[] = {0,0,1,-1};int n,m,a[503][503],dp[503][503];int go(int x, int y, int height) { if(x == n - 1 && y == m - 1) return 1; // 도착하면 1 반환 int &ret = dp[x][y]; if(ret != -1) return ret; // 메모이제이션 ret = 0; // 길이 없다면 0으로 표현해주어야함 // 상하좌우 탐색 for(int i = 0; i = n || ny >= m || nx = a[x][y]) continue; ..