随笔分类 - 字符串
摘要:https://www.luogu.org/problemnew/show/P1019 落骨 分3个板块 : 1. 求出两个字符串最小的重复长度 由题目要求 ,在比较的过程中,一个串不能是另一个串的子串,所以 i != len。 for里面的写法很精妙。。如果找到最小的重复长度,就马上return,
阅读全文
摘要:1 // inserting into a string 2 #include <iostream> 3 #include <string> 4 5 int main () 6 { 7 std::string str="to be question"; 8 std::string str2="the
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 6 char ss[110005],s[220010]; 7 int p[220010]; 8 9 int init() 10 { 11 s[0]='$'; s[1]='#'; 12 int g=2; 13 for(int i=0;...
阅读全文
摘要:1 #include 2 #include 3 using namespace std; 4 #define ull unsigned long long 5 const int maxn=1e6+5; 6 const int base=163; 7 8 char s1[10005],s2[maxn]; 9 ull p[maxn],Hash[maxn]; 10 11 v...
阅读全文