一. function1. 作为表达式或参数时,只有调用是最后一个表达式或参数时才会获得所有结果,其余的只能获得第一个结果(函数没返回值时,第一个结果是nil) 1) 表达式: .. = f1(), f2(), f3() 2) 参数: F(f1(), f2(), f3()) ...
分类:
其他好文 时间:
2014-10-14 13:53:28
阅读次数:
185
题目大意:给定一棵树,可以删掉k条边,求删掉后森林中所有树直径的最大值的最小值
最大值最小,典型的二分答案
此题我们二分树的直径,每次二分DFS一次,对于每个节点统计出所有子树删边后的dis,排序,贪心删掉最大的,直到最大的两个子树相加不会超过二分的答案为止
时间复杂度O(nlog^2n)
老子的二分居然写挂了。。。桑不起啊啊啊啊
#include
#include
#include
#...
分类:
其他好文 时间:
2014-10-13 23:22:27
阅读次数:
183
如果你是位iOS开发者,或者你正想进入该行业,那么Swift为你提供了一个绝佳的机会。Swift的设计非常优雅,较Obj-C更易于学习,当然也非常强大。为了指导开发者使用Swift进行开发,苹果发布了一系类的技术文档,比如The Swift Programming Language(中文)和Usin...
分类:
编程语言 时间:
2014-10-13 15:40:39
阅读次数:
220
温帮知新呢,原文在这里:https://www.simple-talk.com/sql/t-sql-programming/sql-server-cte-basics/http://www.codeproject.com/Articles/265371/Common-Table-Expression...
分类:
数据库 时间:
2014-10-13 12:20:49
阅读次数:
201
Doing翻译 SDCC 手册翻译 why function programming matterTo Doautotool, autoconf, automakeDone
分类:
其他好文 时间:
2014-10-13 12:16:29
阅读次数:
171
The Java API for XML Processing (JAXP) is for processing XML data using applications written in the Java programming language. JAXP leverages the pars...
分类:
其他好文 时间:
2014-10-12 19:30:48
阅读次数:
198
问题详述:http://coursera.cs.princeton.edu/algs4/assignments/queues.htmlDequeue. A double-ended queue or deque (pronounced "deck") is a generalization of a...
分类:
其他好文 时间:
2014-10-12 13:17:48
阅读次数:
244
英文原文:12 predictions for the future of programming 编程世界的将来如何目前仍难预料,但可以肯定的一点是技术一直在加速发展。以下搜罗出 12 个独特的视角猜想,我们一起来看看有哪些猜想在不久的将来就能变为现实? 1. GPU接班 CPU 游戏玩...
分类:
其他好文 时间:
2014-10-11 12:25:45
阅读次数:
262
问题描述可以详见:http://coursera.cs.princeton.edu/algs4/assignments/percolation.html关于QuickFindUF的javadoc:http://algs4.cs.princeton.edu/15uf/QuickFindUF.java....
分类:
其他好文 时间:
2014-10-10 23:12:54
阅读次数:
1583
Polymorphism is often referred to as the third pillar of object-oriented programming, after encapsulation and inheritance. It has two distinct aspects:
At run time, objects of a derived class may...
分类:
其他好文 时间:
2014-10-10 14:05:54
阅读次数:
158