![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM_字符串
文章平均质量分 95
ACM_字符串
蔡军帅
好好学习,天天向上!
展开
-
PAT 甲级 1050 String Subtraction (20 分) (简单送分,getline(cin,s)的使用)
1050String Subtraction(20分)Given two stringsS1andS2,S=S1−S2is defined to be the remaining string after taking all the characters inS2fromS1. Your t...原创 2019-09-07 23:07:00 · 139 阅读 · 0 评论 -
拦截导弹简单版(读入一串整数时getline(cin,s) stringstream is(s);)
拦截导弹简单版时间限制: 1 Sec 内存限制: 128 MB提交: 40 解决: 16[提交][状态][讨论版][命题人:外部导入]题目描述某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的导弹来袭。由于该系统还在试用阶段,所以只有...原创 2018-05-08 14:59:00 · 198 阅读 · 0 评论 -
CCPC2018-湖南全国邀请赛 G String Transformation
G.String Transformation题目描述Bobo has a string S = s1 s2...sn consists of letter a , b and c . He can transform the string by inserting or deleting substrings aa , bb and abab .Formally, A = u...原创 2018-05-19 23:37:00 · 189 阅读 · 0 评论 -
PAT 甲级 1055 The World's Richest (25 分)(简单题,要用printf和scanf,否则超时,string 的输入输出要注意)...
1055The World's Richest(25分)Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed ...原创 2019-09-18 16:10:00 · 157 阅读 · 0 评论 -
PAT 甲级 1069 The Black Hole of Numbers (20 分)(内含别人string处理的精简代码)
1069The Black Hole of Numbers(20分)For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decre...原创 2019-10-31 12:51:00 · 148 阅读 · 0 评论 -
hdu1 247 Hat’s Words(字典树)
Hat’s Words Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16970 Accepted Submission(s): 6098 Problem Description...原创 2018-02-15 22:11:00 · 61 阅读 · 0 评论 -
HDU 1671 Phone List(字典树)
Phone ListTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 22697 Accepted Submission(s): 7684Problem DescriptionGiven a list of ph...原创 2018-02-17 22:46:00 · 79 阅读 · 0 评论 -
HDU 2846 Repository(字典树,每个子串建树,*s的使用)
Repository Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 6444 Accepted Submission(s): 2096 Problem Description ...原创 2018-02-18 12:40:00 · 162 阅读 · 0 评论 -
HDU 1298 T9(字典树+dfs)
T9 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3527 Accepted Submission(s): 1318 Problem Description A while...原创 2018-02-16 15:54:00 · 209 阅读 · 0 评论 -
HDU 1251 统计难题(字典树)
统计难题Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 48444 Accepted Submission(s): 17131Problem DescriptionIgnatius最近遇到一个难题,老师交给他...原创 2018-02-17 23:37:00 · 79 阅读 · 0 评论 -
字符串的问题(substr,find用法)
链接:https://www.nowcoder.com/acm/contest/77/C来源:牛客网字符串的问题 时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld题目描述有一个字符串 让你找到这个字符串 S 里面的子串T 这个子串 T 必须满...原创 2018-02-25 19:16:00 · 706 阅读 · 0 评论 -
PAT 甲级 1039 Course List for Student (25 分)(字符串哈希,优先队列,没想到是哈希)*...
1039Course List for Student(25分)Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to ou...原创 2019-08-30 17:38:00 · 139 阅读 · 0 评论 -
PAT 甲级 1040 Longest Symmetric String (25 分)(字符串最长对称字串,遍历)
1040Longest Symmetric String(25分)Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, givenIs PAT&TAP symmetric?, the...原创 2019-08-31 09:36:00 · 164 阅读 · 0 评论 -
四川第七届 C Censor (字符串哈希)
Censor frog is now a editor to censor so-called sensitive words (敏感词). She has a long text pp. Her job is relatively simple -- just to find the first occurence of sensitive word ww a...原创 2018-04-26 21:18:00 · 265 阅读 · 0 评论 -
二叉搜索树的结构(30 分) PTA 模拟+字符串处理 二叉搜索树的节点插入和非递归遍历...
二叉搜索树的结构(30 分) PTA 模拟+字符串处理 二叉搜索树的节点插入和非递归遍历 二叉搜索树的结构(30 分)二叉搜索树或者是一棵空树,或者是具有下列性质的二叉树: 若它的左子树不空,则左子树上所有结点的值均小于它的根结点的值;若它的右子树不空,则右子树上所有结点的值均大于它的根结点的值;它的左、右子树也分别为二叉搜索树。(摘自百度百科)给定一系列互不相等...原创 2018-03-29 20:35:00 · 411 阅读 · 0 评论 -
Python——字符串(python programming)
Python——字符串(python programming) python——字符串①加法 连接两个字符串②乘法 复制字符串python——转义字符\n 换行\' 单引号\'' 双引号\\ 反斜杠raw字符串:无视转义字符转义:字符串和数字相互转化函数str(), int(), float()字符...原创 2019-03-25 15:55:00 · 259 阅读 · 0 评论 -
PAT 甲级 1047 Student List for Course (25 分)(cout超时,string scanf printf注意点,字符串哈希反哈希)...
1047Student List for Course(25分)Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to...原创 2019-09-05 15:00:00 · 173 阅读 · 0 评论 -
P3370 【模板】字符串哈希
题目描述如题,给定N个字符串(第i个字符串长度为Mi,字符串内包含数字、大小写字母,大小写敏感),请求出N个字符串中共有多少个不同的字符串。输入输出格式输入格式:第一行包含一个整数N,为字符串的个数。接下来N行每行包含一个字符串,为所提供的字符串。输出格式:输出包含一行,包含一个整数,为不同的字符串个数。输入输出样例输入样例#1:复...原创 2019-12-16 22:32:27 · 210 阅读 · 0 评论 -
PAT 甲级 1022 Digital Library (30 分)(字符串读入getline,istringstream,测试点2时间坑点)...
1022Digital Library(30分)A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book ...原创 2019-08-12 15:23:00 · 225 阅读 · 1 评论 -
PTA 说反话-加强版(20 分)(字符串处理)
说反话-加强版(20 分) 给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出。 输入格式: 测试输入包含一个测试用例,在一行内给出总长度不超过500 000的字符串。字符串由若干单词和若干空格组成,其中单词是由英文字母(大小写有区分)组成的字符串,单词之间用若干个空格分开。 输出格式: ...原创 2018-03-11 15:33:00 · 303 阅读 · 0 评论 -
NOIP 2008 立体图 (字符串+模拟)
立体图时间限制: 1 Sec 内存限制: 50 MB提交: 2 解决: 0[提交][状态][讨论版][命题人:外部导入]题目描述小渊是个聪明的孩子,他经常会给周围的小朋友们讲些自己认为有趣的内容。最近,他准备给小朋友们讲解立体图,请你帮他画出立体图。小渊有一块面积为m*n的矩形区域,上面有m*n个边长为1的格子,每个格子上堆了一些同样大小的吉姆(积木的长宽高都是...原创 2018-05-10 15:49:00 · 195 阅读 · 0 评论 -
新浪微博热门话题(30 分)(字符串)
新浪微博热门话题(30 分) 新浪微博可以在发言中嵌入“话题”,即将发言中的话题文字写在一对“#”之间,就可以生成话题链接,点击链接可以看到有多少人在跟自己讨论相同或者相似的话题。新浪微博还会随时更新热门话题列表,并将最热门的话题放在醒目的位置推荐大家关注。 本题目要求实现一个简化的热门话题推荐功能,从大量英文(因为中文分词处...原创 2018-03-12 22:41:00 · 2021 阅读 · 0 评论 -
家谱处理(30 分)(字符串的处理substr)
家谱处理(30分) 人类学研究对于家族很感兴趣,于是研究人员搜集了一些家族的家谱进行研究。实验中,使用计算机处理家谱。为了实现这个目的,研究人员将家谱转换为文本文件。下面为家谱文本文件的实例: John Robert Frank Andrew Nancy
...原创 2018-03-12 22:43:00 · 239 阅读 · 0 评论 -
Python——字符串2.0(实验)(python programming)
Python——字符串2.0(实验)(python programming) 直接打s,是程序员看到的;打print(),是用户看到的列表]#列表索引,与数组唯一不同:等号左端可修改转载自:https://www.cnblogs.com/wwwwwei/p/10481653.html...原创 2019-03-25 15:53:00 · 251 阅读 · 0 评论 -
国防科大KMP算法求next数组(下标从0开始,相当于优化后的nextval)
#include<bits/stdc++.h>using namespace std;int main(){ char s[105]; while(cin>>s) { int next[105]; memset(next,0,sizeof(next)); int i=0,j=...原创 2020-11-22 16:03:00 · 568 阅读 · 0 评论 -
KMP算法解释
给定两个字符串A,B,判断T是否为S的子串(变式:寻找子串B在串A中的位置)。 要求一个O(|A|+|B|)的做法。 通常称A为目标串(或主串),B为模式串。 算法过程: 我们假设串A的长度为n,串B的长度为m,每个字符串的开头下标默认为1。 定义两个变量i和j,这两个变量共同表示:A[i-j+1~i]与B[1~j]均匹配,即:A中以第i个字符结尾的、长度为j的字符...原创 2018-02-12 17:17:00 · 274 阅读 · 0 评论 -
HDU 1686 Oulipo(优化的KMP)
OulipoTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 17441 Accepted Submission(s): 6938Problem DescriptionThe French author Geor...原创 2018-02-12 20:09:00 · 68 阅读 · 0 评论 -
HDU 3746 Cyclic Nacklace (用kmp求循环节)
Cyclic NacklaceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11516 Accepted Submission(s): 4913Problem DescriptionCC always bec...原创 2018-02-12 20:53:00 · 60 阅读 · 0 评论 -
详解KMP算法
详解KMP算法 KMP算法应该是每一本《数据结构》书都会讲的,算是知名度最高的算法之一了,但很可惜,我大二那年压根就没看懂过~~~之后也在很多地方也都经常看到讲解KMP算法的文章,看久了好像也知道是怎么一回事,但总感觉有些地方自己还是没有完全懂明白。这两天花了点时间总结一下,有点小体会,我希望可以通过我自己的语言来把这个算法的一些细节梳理清楚,也算是考验一下自己有真正理解这个算法。...原创 2019-04-13 14:54:00 · 115 阅读 · 0 评论 -
1711 Number Sequence(kmp)
Number Sequence Time Limit : 10000/5000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 90 Accepted Submission(s) : 57 Font: Times New Roman | ...原创 2018-02-12 16:03:00 · 59 阅读 · 0 评论 -
HDU 3336 Count the string(KMP+DP)
Count the stringTime Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 52 Accepted Submission(s) : 27Font: Times New Roman | Verdana | Georg...原创 2018-02-13 12:46:00 · 69 阅读 · 0 评论 -
HDU 1358 Period (kmp判断循环子串)
PeriodTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 53 Accepted Submission(s) : 27Font: Times New Roman | Verdana | GeorgiaFont Si...原创 2018-02-13 11:24:00 · 220 阅读 · 0 评论