题目链接:点击打开链接题意:给定长度为n的字符串s,常数k显然s的子串一共同拥有 n(n-1)/2 个要求找到一个长度为n的字符串t,使得t相应位置的k个子串字典序>s#include#include#include#include#include#includeusing namespace st...
分类:
其他好文 时间:
2014-10-02 16:33:53
阅读次数:
193
Upon a homely object Love can wink.—William Shakespeare, The Two Gentlemen of VeronaThe simple types of JavaScript are numbers, strings, booleans (tru...
分类:
编程语言 时间:
2014-10-01 15:31:31
阅读次数:
351
Elegant String
We define a kind of strings as elegant string: among all the substrings of an elegant string, none of them is a permutation of "0, 1,…, k".
Let function(n, k) be the numbe...
分类:
其他好文 时间:
2014-09-30 18:43:49
阅读次数:
248
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2014-09-30 17:19:19
阅读次数:
173
string类型是不可变的,因此不能采用直接赋值的方式。比如一个字符串 helloworld,想把o替换成z,那么只有先替换,然后再迭代。strings="helloworld"hello=strings.replace('o','z')for index,string in enumerate(h...
分类:
编程语言 时间:
2014-09-30 13:26:19
阅读次数:
235
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".算法:模拟加法过程 1 class Solution { 2 public: 3 st...
分类:
其他好文 时间:
2014-09-30 11:05:31
阅读次数:
155
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
这个题说数可能是任意的大的非负数,肯定不是让你直接乘起来返回(我干了。。)而是...
分类:
其他好文 时间:
2014-09-30 06:45:32
阅读次数:
167
方法 1、 show create table table_name;可以用这个看表的代码。 show create table Strings; 方法 2、 show full columns from table_name; show full columns fr...
分类:
数据库 时间:
2014-09-29 23:48:21
阅读次数:
237
Description
A substring of a string T is defined as:
T( i, k)= TiTi+1... Ti+k-1, 1≤ i≤ i+k-1≤| T|.
Given two strings A, B and one integer K, we define S, a set of triples (i, j, k):
S = ...
分类:
其他好文 时间:
2014-09-29 14:38:51
阅读次数:
277
strings存在三种“大小”:1、size()和length() 返回string中现在的字符个数。上述两个函数等效。成员函数empty()用来检验字符数是否为0,亦即字符串是否为空。你应该优先使用该函数,因为它比length()或size()来得快。也就是说,使用if(s.empty()==tr...
分类:
其他好文 时间:
2014-09-29 00:15:16
阅读次数:
248