Short Substrings 题目链接:https://codeforces.com/contest/1367/problem/A 题意 给出一个字符串 tt,找出原字符串 ss,tt 由ss 从左至右的所有长为 22 的子串构成。 题解 只有ss 的首尾字符会只在 tt 中出现一次,其余字符都会重复出现两次。 代码 #include <bits/stdc++.h> using namespace std; void ...
AC代码: #include<bits/stdc++.h>usingnamespacestd;intmain(){intt;cin>>t;while(t--){strings;cin>>s;for(inti=0;i<s.size();i+=2)cout<<s[i];cout<<s[s.size()-1];cout<<endl;}}
Codeforces Round #650 (Div. 3) A-F1题解 A. Short Substrings 题目链接 题意: Bob提出了字符串a=“abac”,那么字符串a中所有长度为2的子字符串都是:“ab”,“ba”,“ac”。因此,字符串b=“abbaac”。给你一个字符串b,求a。 题解: a[0]=b[0],a[1]=b[1],然......
which by the above analysis is the same as saying that the endpoints of the occurences ofuandvinsagree. Thus one could also say that the nodes of the suffix automaton correspond to the equivalence classes of substrings ofsunder this relation. ...