题意:两地之间有n条不相交路径,第i条路径由a[i]座桥组成,每座桥有一个损坏概率,让你确定一个对所有桥的检测顺序,使得检测所需的总期望次数最小。 首先,显然检测的时候,是一条路径一条路径地检测,跳跃地检测没有意义。考虑已经排好的某个路径的顺序,相邻的两条路径j和j+1如果满足: (route[j] ...
分类:
编程语言 时间:
2018-05-01 10:50:19
阅读次数:
163
题意:平面上n个点,每个点带有一个或正或负的权值,让你在平面上放一个内边长为2l,外边长为2r的正方形框,问你最大能圈出来的权值和是多少? 容易推出,能框到每个点的 框中心 的范围也是一个以该点为中心的相同大小的框。 于是,把每个点的框拆成4条线。从下往上扫过去,最下面的线,给[R,R]区间加上该点 ...
第三次作业 题目6 1输出月份英文名 1.设计思路 (1)主要描述题目算法 第一步:先定义一个指针数组char month[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "Septem ...
分类:
其他好文 时间:
2018-04-29 21:17:05
阅读次数:
199
6 1 输出月份英文名 设计思路 1、算法 第一步:看函数,看函数声明 第二步:理解分析 2、流程图如下 代码如下 ... char a[12][15]={"January","February","March","April","May","June","July","August","Septe ...
分类:
编程语言 时间:
2018-04-22 22:44:39
阅读次数:
362
6 1输出月份英文名 主要描述题目算法 第一步:定义指针数组 month[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "Novembe ...
分类:
其他好文 时间:
2018-04-15 18:02:49
阅读次数:
189
Knowledge makes humble, ignorance makes proud. 博学使人谦逊,无知使人骄傲。 Humility is not equal with being passive, submissive or insecure, instead, humility mean ...
分类:
其他好文 时间:
2018-04-05 13:23:51
阅读次数:
180
Those are my principles, and if you don't like them... well, I have others. 那是我的原则,要是你不喜欢......那我还有其他原则。 From Groucho Marx. Please hold on to your pri ...
分类:
其他好文 时间:
2018-04-01 15:23:13
阅读次数:
193
Confine yourself to the present. 着眼当下。 The morning wind spreads its fresh smell, we should get up and take that in, that wind lets us live, breathe, b ...
分类:
其他好文 时间:
2018-03-30 20:10:24
阅读次数:
164
Receive without conceit, release without struggle. 接受时,不狂妄;放手时,不犹豫。 How to understand this quote? Doesn't it mean that when we are given some gifts fr ...
分类:
其他好文 时间:
2018-03-28 10:27:19
阅读次数:
136
Don't cry for what is lost. Smile for what still remains. 别为失去的哭泣,为还留在你身边的一切微笑吧。 I have been told that if crying for missing the sun, we may miss the ...
分类:
其他好文 时间:
2018-03-26 23:38:30
阅读次数:
202