백준 알고리즘/다이나믹 프로그래밍75 백준 9252번 C++ #include #include #include #include using namespace std; const int MAX = 1001;string s1, s2;int cache[MAX][MAX];string ansstring; int LIS(int i, int j) {if (i == s1.size() || j == s2.size())return 0;int &answer = cache[i][j];if (cache[i][j] != -1)return cache[i][j]; return answer = max(LIS(i + 1, j), max(LIS(i, j + 1), LIS(i + 1, j + 1) + (s1[i] == s2[j])));} void calstring(int i, int j) {if (i .. 2019. 2. 16. 백준 1915번 C++ 2019. 2. 14. 백준 6359번 C++ #include #include using namespace std; const int MAX = 101;int t,room;int roomnum[MAX]; int escape(int r) {memset(roomnum, 0, sizeof(roomnum)); for (int i = 1; i > room;cout 2019. 2. 13. 백준 1309번 C++ #include #include using namespace std; const int MAX = 100001;const int MOD = 9901;int n;long long lionnum[3][MAX]; int lionnumcal() {lionnum[0][1] = lionnum[1][1] = lionnum[2][1] = 1; for (int i = 2; i > n;memset(lionnum, 0, sizeof(lionnum));cout 2019. 2. 13. 이전 1 ··· 11 12 13 14 15 16 17 ··· 19 다음