题目链接:poj 2406 Power Strings 题意: 给你一个字符串,让你找出这个字符串的最大循环次数,及最小循环节。 题解: 用kmp的nxt数组搞搞,L=j-nxt[j],为前缀j的最小循环节。 1 #include<cstdio> 2 #include<algorithm> 3 #i ...
分类:
编程语言 时间:
2017-07-30 22:03:33
阅读次数:
221
Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. 求最长公共前缀。 代码例如以下: class Solution { public: ...
分类:
其他好文 时间:
2017-07-30 12:37:55
阅读次数:
138
Surprising Strings Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7225 Accepted: 4663 Description The D-pairs of a string of letters are t ...
分类:
其他好文 时间:
2017-07-29 20:25:32
阅读次数:
129
Problem In DNA strings, symbols 'A' and 'T' are complements of each other, as are 'C' and 'G'. The reverse complement of a DNA string ss is the string ...
分类:
其他好文 时间:
2017-07-29 15:11:38
阅读次数:
128
题目链接:UVALive - 4811 Growing Strings 题意: 给你n个字符串,问你最多能选出多少个字符串,使得s[i]是s[i+1]的子串。 题解: 先将所有的字符串插入AC自动机,将所有字符串按长度排序后,显然dp[i]=max{dp[j]}+1,其中s[j]是s[i]的子串。然 ...
总的来说这是一个将字符串转化为数字进行计算再转化为字符串的计算,醉生与死; Given the string representations of two integers, return the string representation of the sum of those integers. ...
分类:
其他好文 时间:
2017-07-28 17:38:53
阅读次数:
191
Make a program that filters a list of strings and returns a list with only your friends name in it. If a name has exactly 4 letters in it, you can be ...
分类:
其他好文 时间:
2017-07-25 12:33:50
阅读次数:
200
Notification noti = new Notification.Builder(this) .setContentTitle(methodName + " " + strings[strings.length - 1]) //设置Notification标题, .setAutoCancel... ...
分类:
其他好文 时间:
2017-07-24 22:24:44
阅读次数:
135
665C - Simple Strings 思路:贪心。为了保证最小改变着次数,在改变每个相邻相同的字符时,保证改变后的字符和后面也不相同。 代码: ...
分类:
其他好文 时间:
2017-07-24 17:32:49
阅读次数:
121
原文地址:http://blog.sina.com.cn/s/blog_68f262210102vzf9.html 常用的API函数 获取信息类API (1)获取默认系统语言对应的Strings.xml文件内的数据。 get_app_string() (2)查找某一个语言环境对应的字符串文件Stri ...
分类:
移动开发 时间:
2017-07-23 21:07:58
阅读次数:
254