dp

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

180124_10942_팰린드롬?

//https://www.acmicpc.net/problem/10942#include #include using namespace std;int num[2001];bool dp[2001][2001]; int main() { int n, m; int start, end; scanf("%d",&n); for(int i=1; i

알고리즘 문제 풀이/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..

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

180123_11057_오르막수

//https://www.acmicpc.net/problem/11057#include using namespace std;int dp[10][1001]; int main(){ int n, sum; cin >> n; if(n==1) { cout

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

180122_9507_Generations of Tribbles

//https://www.acmicpc.net/problem/9507#include using namespace std;long long koong[68]; int main() { int t; cin >> t; for(int i=0; i>n; for(int j=0; j0) continue; if(j

bong sue
'dp' 태그의 글 목록 (4 Page)