목록분류 전체보기 (153)
늘
#include #include #include #include using namespace std; string c; string s; string boom; int main() { cin.sync_with_stdio(false); cin.tie(NULL); int del = 0; cin >> c; cin >> boom; int i; int last = boom.length() - 1;//boom의 마지막 문자 for (i = 0; i =last) { del = 0; for (int j = 1; j < boom.length(); ++j) { if (boom[last - j] != s[s.size(..
첫 알고리즘은 백준에 있는 난이도 골드5인 LCS문제이다 문자열 길이를 구하는 문제로 알고리즘을 모르면 해매기 쉬울것 같다. #include #include #include #include using namespace std; int dp[1001][1001]; int main() { string main_str, sub_str; cin >> main_str >> sub_str; main_str = "0" + main_str; sub_str = "0" + sub_str; int main_len = main_str.length(); int sub_len = sub_str.length(); for (int i = 1; i < main_len; ++i) { for (int j = 1; j < sub_len; ..
이제 알고리즘 공부는 여기에 적어두려고 한다!