我以为像a、aa这样的输入应该是没有输出的,结果还是要输出aa。建树的时候就是常规建树,不过查找的时候要做一些变形:对于一个单词,从第一位检查有没有单词是它的前缀,如果有的话,再去检查它的后半部分是不是一个独立的单词,要满足这两次查找才能输出。题意:给一些单词(以字典序输入),找出那些可以分成另外的...
分类:
其他好文 时间:
2014-06-26 18:33:13
阅读次数:
173
【题目】
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 = "aab",
Return 1 since the palindrome partitioning ["aa","b"] could b...
分类:
其他好文 时间:
2014-06-26 07:48:00
阅读次数:
259
1.后台调用前台JS方法(带参数)ClientScript.RegisterStartupScript(类型,键,调用的JS方法名(+参数+),是否启用该方法(true or flase));例:ClientScript.RegisterStartupScript(typeof(Page), "aa...
分类:
其他好文 时间:
2014-06-26 00:30:25
阅读次数:
322
gc d:\vm.txt|foreach -begin {write-host "It's beginning."} -process {$_ +"aa"} -end {write-host "The end"}
分类:
其他好文 时间:
2014-06-25 22:50:17
阅读次数:
243
mysql replace用法 1.replace into replace into table (id,name) values('1','aa'),('2','bb') 此语句的作用是向表table中插入两条记录。如果主键id为1或2不存在 就相当于 insert into table (id...
分类:
数据库 时间:
2014-06-25 18:51:56
阅读次数:
287
python解释器将__init__函数里的__z变量转成 _classname__z了,明确规则后外部依旧能够通过实力对象来訪问。In [1]: class aa: ...: def __init__(self): ...: self.x = 10 ...: ...
分类:
编程语言 时间:
2014-06-25 16:12:09
阅读次数:
211
中文题不解释
Sample Input
3
AA
BB
CC
ooxxCC%dAAAoen....END
Sample Output
AA: 2
CC: 1
输出病毒出现的次数!
#include
#include
#include
#include
#include
using namespace std;
const int k...
分类:
其他好文 时间:
2014-06-25 08:04:33
阅读次数:
213
题目大意:
求n边形的费马点,即找到一个点使得这个点到n个点的距离之和最小。
解题思路:
三角形也有费马点,三角形费马点是这样定义的:寻找三角形内的一个点,使得三个顶点到该点的距离之和最小。
三角形费马点的做法是:
(1)若有一个角大于120度,那么这个角所在的点就是费马点。
(2)若不存在,那么对于三角形ABC,任取两条边(假设AB、AC),向外做等边三角形得到C' 和 A' ,那么AA' 和CC' 的交点就是费马点。
那么对于这题n多边形,我采取的策略完全不同,采用了模拟退火的做法,这种做法相对比...
分类:
其他好文 时间:
2014-06-25 00:09:27
阅读次数:
319
题意:
给定n,AA
下面n个数m1,m2···mn
则有n条方程
res % m1 = m1-AA
res % m2 = m2-AA
问res的最小值
直接上剩余定理,嘿嘿
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define ll ...
分类:
其他好文 时间:
2014-06-24 22:32:50
阅读次数:
315
A
Time Limit: 60ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
给出n(1
输入
单组输入。第一行输入一个数字n,接下来n行,每行包含一个字符串。
输出
输出一个数字代表答案。
示例输入
5
aba
abb
w
aba
z
示例输出
2
提示...
分类:
其他好文 时间:
2014-06-22 11:25:18
阅读次数:
206