백준

알고리즘 문제 풀이/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_1977_완전제곱수

//https://www.acmicpc.net/problem/1977#include using namespace std; int main(){ int m,n, sum, min; cin >> m>> n; sum=0; min=0; for(int i=1; i=m) { if(min==0) min=i*i; for(int j=i; j*j

알고리즘 문제 풀이/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
'백준' 태그의 글 목록 (19 Page)