摘要: 首先对字符串首先要求一个前缀函数$\pi[i]$。$\pi[i]$简单来说就是子串$s[0\dots i]$最长的相等的真前缀与真后缀的长度。 ```cpp vector prefix_function(const string &s) { int n = s.size(); vector pi(n 阅读全文
posted @ 2023-06-01 22:21 PHarr 阅读(7) 评论(0) 推荐(0) 编辑
摘要: # A 最小的数字 ```cpp #include using namespace std; #define int long long int32_t main() { ios::sync_with_stdio(false), cin.tie(0), cout.tie(0); int n; cin 阅读全文
posted @ 2023-06-01 22:18 PHarr 阅读(9) 评论(0) 推荐(0) 编辑
摘要: # **A - Similar String** ```cpp #include using namespace std; #define int long long int32_t main() { int n; string s , t; cin >> n >> s >> t; for( int 阅读全文
posted @ 2023-06-01 10:55 PHarr 阅读(94) 评论(0) 推荐(0) 编辑