poj 1655:http://poj.org/problem?id=1655题意: 给无根树, 找出以一节点为根, 使节点最多的树,节点最少。题解:一道树形dp,先dfs 标记 所有节点的子树的节点数。 再dfs 找出以某节点为根的最大子树,节点最少。 复杂度(n)/***Good Luck***...
分类:
其他好文 时间:
2014-08-08 12:25:25
阅读次数:
246
这是一个姓Boy的人发现的,所以取名为Boy surface.该图形与罗马图形有点相似,都是三分的图形.它甚至可以说是由罗马曲面变化而成的.本文将展示几种Boy曲面的生成算法和切图,使用自己定义语法的脚本代码生成数学图形.相关软件参见:数学图形可视化工具,该软件免费开源.QQ交流群: 3677528...
分类:
其他好文 时间:
2014-08-08 09:31:35
阅读次数:
255
题目大意:
给出一个A串和很多个B串,求出A中有多少个子串,是所有的B中没有出现的。
思路分析:
后缀数组的作用很容易的求出来整个串中不同的子串个数。
现在要求的是A中不同的,且在B中没有出现过的。
先把AB 串全部连接,跑一遍suffix array。然后求出有多少个不同的子串。
然后再单独用B 串跑 suffix array。再求出单独在B 中有多少个不同的 子串。...
分类:
其他好文 时间:
2014-08-07 23:16:25
阅读次数:
257
1057. Amount of Degrees
Time limit: 1.0 second
Memory limit: 64 MB
Create a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactlyK different integer de...
分类:
其他好文 时间:
2014-08-07 19:03:10
阅读次数:
384
Get Luffy Out
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 7456
Accepted: 2835
Description
Ratish is a young man who always dreams of being a hero. One ...
分类:
其他好文 时间:
2014-08-07 18:55:20
阅读次数:
286
题目:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message....
分类:
编程语言 时间:
2014-08-07 05:11:09
阅读次数:
247
Network virtualization is a growing topic of interest and for some good reasons as networks scale to meet the challenges of cloud computing they are r...
分类:
Web程序 时间:
2014-08-06 22:23:52
阅读次数:
452
'use strict';/* We need to tell jshint what variables are being exported *//* global -angular, -msie, -jqLite, -jQuery, -slice, -pus...
分类:
Web程序 时间:
2014-08-06 18:48:51
阅读次数:
447
//求一句话里单词的个数 前面空格后面非空格 计数器加1//she is a good girl ====5个int CountWords(char c[]){ int word=0; int sum=0; char *p=c; for (;*p!='\0';p++) ...
分类:
其他好文 时间:
2014-08-06 01:29:40
阅读次数:
196
Problem DescriptionAlice and Bob are playing together. Alice is crazy about art and she has visited many museums around the world. She has a good memo...