题目
Given a string s, partition s such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of s.
For example, given s = "a...
分类:
其他好文 时间:
2014-06-20 13:44:18
阅读次数:
234
First-class Everything-- Guido van
RossumFirst-class object:
第一类对象。意指可在执行期创建并作为参数传递给其他函数或存入一个变量的对象。简而言之,第一类对象在使用时没有任何限制。第一类对象典型特征是可以动态创建、销毁,作为参数传递,可以作...
分类:
编程语言 时间:
2014-06-20 08:48:46
阅读次数:
287
进入vi的命令 vi filename :打开或新建文件,并将光标置于第一行首 vi +n
filename :打开文件,并将光标置于第n行首 vi + filename :打开文件,并将光标置于最后一行首 vi +/pattern
filename:打开文件,并将光标置于第一...
分类:
系统相关 时间:
2014-06-20 08:46:49
阅读次数:
406
概要:
实例代码详解:
目录结构
Car.java
package com.coslay.beans.factorybean;
public class Car {
private String brand;
private double price;
public String getBrand() {
return brand;
}
...
分类:
编程语言 时间:
2014-06-07 13:54:02
阅读次数:
252
题目大意:
三个操作。
1. 合并两个集合
2.把第一个元素放到第二个集合里
3.输出集合的数量和和。。
思路分析:
要用p记录这个元素所在集合编号,然后用编号建立并查集。
#include
#include
#include
#include
using namespace std;
typedef long long LL;
int set[111111...
分类:
其他好文 时间:
2014-06-07 12:52:40
阅读次数:
267
在做根据日期来检索的时候普通的格式化会出错,试了好多种只有一种可行
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
String time = "lostTime:["+sdf.format(new Date())+" TO "+sdf.format(new Date())+"]";...
分类:
其他好文 时间:
2014-06-07 12:48:43
阅读次数:
256
python实现的链表,包括插入、查找、删除操作
#!/usr/bin/python
class linknode():
def __init__(self,k,n=None):
self.key=k;
self.next=n;
def createlist(): #创建链表
n=raw_input("enter the num of nodes");
n=int(...
分类:
编程语言 时间:
2014-06-07 12:23:46
阅读次数:
204
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca...
分类:
其他好文 时间:
2014-06-07 12:21:30
阅读次数:
284
例如输入:I love programming
输出:I evol gnimmargorp
算法思路就是:根据空格提取每一个单词,存放在一个buffer里进行翻转处理,再添加到新的字符串。最后新的字符串就完成整个方法过程。
public class ReserveString {
public String reserve(String sentence){
Strin...
分类:
编程语言 时间:
2014-06-07 12:20:14
阅读次数:
246
range用法
使用python的人都知道range()函数很方便,今天再用到他的时候发现了很多以前看到过但是忘记的细节。
这里记录一下:
>>>
range(1,5)
#代表从1到5(不包含5)
[1,
2,
3,
4]
>>>
range(1,5,2)
#代表从1到5,间隔2(不包含5)
[1,
3]
>...
分类:
编程语言 时间:
2014-06-07 12:09:21
阅读次数:
276