随笔分类 -  字符串

FZU1989 AntiAC —— 字符串
摘要:题目链接:https://vjudge.net/problem/FZU-1989 Problem 1989 AntiAC Accept: 79 Submit: 399Time Limit: 4000 mSec Memory Limit : 32768 KB Accept: 79 Submit: 39 阅读全文

posted @ 2018-03-09 23:48 h_z_cong 阅读(264) 评论(0) 推荐(0)

KMP 、扩展KMP、Manacher算法 总结
摘要:一. KMP 1 找字符串x是否存在于y串中,或者存在了几次 HDU1711 Number Sequence HDU1686 Oulipo HDU2087 剪花布条 2.求多个字符串的最长公共子串 POJ3080 Blue Jeans HDU1238 Substrings 3.next数组的应用 1 阅读全文

posted @ 2017-11-26 15:56 h_z_cong 阅读(279) 评论(0) 推荐(0)

POJ3376 Finding Palindromes —— 扩展KMP + Trie树
摘要:题目链接:https://vjudge.net/problem/POJ-3376 Finding Palindromes Time Limit: 10000MS Memory Limit: 262144K Total Submissions: 4244 Accepted: 796 Case Time 阅读全文

posted @ 2017-11-26 13:07 h_z_cong 阅读(535) 评论(0) 推荐(1)

Educational Codeforces Round 2 C. Make Palindrome —— 贪心 + 回文串
摘要:题目链接:http://codeforces.com/contest/600/problem/C C. Make Palindrome time limit per test 2 seconds memory limit per test 256 megabytes input standard i 阅读全文

posted @ 2017-07-10 11:52 h_z_cong 阅读(260) 评论(0) 推荐(0)

VK Cup 2015 - Round 2 E. Correcting Mistakes —— 字符串
摘要:题目链接:http://codeforces.com/contest/533/problem/E E. Correcting Mistakes time limit per test 2 seconds memory limit per test 256 megabytes input standa 阅读全文

posted @ 2017-06-29 12:50 h_z_cong 阅读(311) 评论(0) 推荐(0)

Educational Codeforces Round 9 C. The Smallest String Concatenation —— 贪心 + 字符串
摘要:题目链接:http://codeforces.com/problemset/problem/632/C C. The Smallest String Concatenation time limit per test 3 seconds memory limit per test 256 megab 阅读全文

posted @ 2017-06-14 20:05 h_z_cong 阅读(147) 评论(0) 推荐(0)

HDU4850 Wow! Such String! —— 字符串构造
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4850 代码如下: 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cstdlib> 5 #inclu 阅读全文

posted @ 2017-05-31 19:01 h_z_cong 阅读(156) 评论(0) 推荐(0)

Codeforces Round #373 (Div. 2) C. Efim and Strange Grade —— 贪心 + 字符串处理
摘要:题目链接:http://codeforces.com/problemset/problem/719/C C. Efim and Strange Grade time limit per test 1 second memory limit per test 256 megabytes input s 阅读全文

posted @ 2017-05-19 22:08 h_z_cong 阅读(235) 评论(0) 推荐(0)

SCUT125 华为杯 D.笔芯回文 —— DP
摘要:题目链接: https://scut.online/p/125 题目描述 bxbx有一个长度一个字符串SS,bxbx可以对其进行若干次操作。 每次操作可以删掉一个长度为k(1 \leq k \leq n)k(1≤k≤n)的连续回文子串,bxbx获得a_ka​k​​的愉悦值。 一个字符串是回文串当且仅 阅读全文

posted @ 2017-05-01 16:08 h_z_cong 阅读(225) 评论(0) 推荐(0)

NYOJ-37 回文字符串 —— LCS变形
摘要:题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=37 题解: 一开始想从两边向中间添加字符,发现这样不是最优的。因为加入字符之后,这些原本存在的字符是离散的,所以就不能用顺序的方法去添加。 正确做法是将字符串逆过来,与原字符串求最大公共子序 阅读全文

posted @ 2017-05-01 10:00 h_z_cong 阅读(144) 评论(0) 推荐(0)

CSU - 1550 Simple String —— 字符串
摘要:题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1550 题解: 1.A+B 与C的交集必须>=n 2.A与C的交集必须>=n/2,B与C的交集必须>=n/2。 代码如下: 1 #include <iostream> 2 #includ 阅读全文

posted @ 2017-04-20 23:11 h_z_cong 阅读(246) 评论(0) 推荐(0)

Kattis - whatdoesthefoxsay —— 字符串
摘要:题目: Kattis - whatdoesthefoxsay Kattis - whatdoesthefoxsay Determined to discover the ancient mystery—the sound that the fox makes—you went into the fo 阅读全文

posted @ 2017-03-24 16:16 h_z_cong 阅读(465) 评论(0) 推荐(0)

Codeforces Round #401 (Div. 2) D Cloud of Hashtags —— 字符串
摘要:题目链接:http://codeforces.com/contest/777/problem/D 题解: 题意:给出n行字符串,对其进行字典序剪辑。我自己的想法是正向剪辑的,即先对第一第二个字符串进行剪辑,但是这样却不能保证前面的操作是正确的,当后面突然出现一个字典序很小的字符串,那么前面的操作将非 阅读全文

posted @ 2017-03-17 14:25 h_z_cong 阅读(198) 评论(0) 推荐(0)

导航