Algorithm/String (2) 썸네일형 리스트형 HABIT #include #include #include #include using namespace std; int getMostHabit(string &habit, int minLength); int getCommonPrefixLength(string &s, int startIdx, int endIdx); vector getSuffixArray(string &habit); int main() { int caseNum = 0; cin >> caseNum; int k = 0; string habit = ""; for (int i = 0; i > k; cin.ignore(); std::getline(std::cin, habit); // Process int most = ge.. JAEHASAFE (KMP 알고리즘) #include #include #include using namespace std; int getMaxDup(const string &first, const string &second); vector getPartialMatch(const string &target); int main() { int caseNum = 0; int n = 0, result = 0; string first = "", second = ""; cin >> caseNum; for (int cIter = 0; cIter > n; cin.ignore(); std::getline(std::cin, first); result = 0; for (int spin = 0; spin < n; s.. 이전 1 다음