摘要: Sample Input6 4 //输出第4个全排列11 8 Sample Output1 2 3 5 6 41 2 3 4 5 6 7 9 8 11 10 1 # include 2 # include 3 # include 4 using namespace std ; 5 6 i... 阅读全文
posted @ 2015-05-12 17:16 __Meng 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Sample Input3aAbabcacbaSample OutputAabAbaaAbabAbAabaAabcacbbacbcacabcbaaabcaacbabacabcaacabacbabaacbacabcaacaabcabacbaa对字符串进行全排列,字符的大小规则: 'A' 2 # i... 阅读全文
posted @ 2015-05-12 17:15 __Meng 阅读(255) 评论(0) 推荐(0) 编辑
摘要: Sample Inputdog ogdaycat atcaypig igpayfroot ootfrayloops oopslayatcayittenkayoopslaySample Outputcatehloops大致题意:输入一个字典,字典格式为“英语à外语”的一一映射关系然后输入若干个外语单词... 阅读全文
posted @ 2015-05-12 17:13 __Meng 阅读(283) 评论(0) 推荐(0) 编辑
摘要: Sample InputSTARTfrom fiwohello difhmars riwosfearth fnnvklike fiiwjENDSTARTdifh, i'm fiwo riwosf.i fiiwj fnnvk!END Sample Outputhello, i'm from mars.... 阅读全文
posted @ 2015-05-12 17:11 __Meng 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Sample Input5 //Tgreenredblueredred 统计颜色的次数 输出最多的颜色3pinkorangepink0 Sample Outputred pink 1 # include 2 # include 3 # include 4 # include 5 ... 阅读全文
posted @ 2015-05-12 17:08 __Meng 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Sample Inputclintonhomerriemannmarjorie Sample Output0rie 3输入两个字符串 ,求最长相同前后缀直接把两个字符串连接在一起求next就行了,唯一要注意的就是长度不能大于原来任一字符串的长度,如果长度大于了,要选择len1和len2中较小的一个输... 阅读全文
posted @ 2015-05-12 17:04 __Meng 阅读(670) 评论(0) 推荐(0) 编辑
摘要: Sample Input14abab Sample Output6输出包括从1到len长 字符串前缀的总个数abab:包括2个a,2个ab,1个aba,1个abab 1 # include 2 # include 3 using namespace std; 4 5 char S[20001... 阅读全文
posted @ 2015-05-12 17:03 __Meng 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Sample Input3aaaabcaabcde Sample Output025题目大意:给你一个字符串,要求将字符串的全部字符最少循环2次需要添加的字符数。例子:abcabc 已经循环2次,添加数为0abcac 没有循环2次,添加字符abcac。数目为5.abcabcab 已经循环过2次,但第... 阅读全文
posted @ 2015-05-12 17:02 __Meng 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 给一个串,让你找一个子串,形如EAEBE,就是一个串在开头结尾中间各出现一次,问这个E最长是多少Sample Input5xyabcaaaaaaabaaaxoaaaaa Sample Output00112 1 # include 2 # include 3 using namespace... 阅读全文
posted @ 2015-05-12 17:01 __Meng 阅读(267) 评论(0) 推荐(0) 编辑
摘要: Sample Inputabcdaaaaababab.Sample Output1 //1个abcd4 //4个a3 //3个ab 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const ... 阅读全文
posted @ 2015-05-12 17:00 __Meng 阅读(464) 评论(0) 推荐(0) 编辑
摘要: Sample Input3aaa12aabaabaabaab0Sample OutputTest case #12 23 3Test case #22 2 //aa有2个a6 2 //aabaab有2个aab9 312 40 1 2 3 4 5 6 7 8 9 10 11a a b a ... 阅读全文
posted @ 2015-05-12 16:58 __Meng 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 求模式串在主串中出现的次数Sample Input3BAPCBAPCAZAAZAZAZAVERDIAVERDXIVYERDIANSample Output130 1 #include 2 #include 3 using namespace std; 4 5 const int N = 100... 阅读全文
posted @ 2015-05-12 16:45 __Meng 阅读(402) 评论(0) 推荐(0) 编辑
摘要: Sample Input213 51 2 1 2 3 1 2 3 1 3 2 1 21 2 3 1 313 51 2 1 2 3 1 2 3 1 3 2 1 21 2 3 2 1 Sample Output6-1 1 # include 2 # include 3 # include 4 us... 阅读全文
posted @ 2015-05-12 16:43 __Meng 阅读(339) 评论(0) 推荐(0) 编辑