摘要: The i’th Fibonacci number f(i) is recursively defined in the following way: • f(0) = 0 and f(1) = 1 • f(i + 2) = f(i + 1) + f(i) for every i ≥ 0 Your t 阅读全文
posted @ 2019-04-28 20:14 蓉~ 阅读(298) 评论(0) 推荐(0) 编辑
摘要: Description Tom is the most handsome CCPC contestant in HIT.Tom likes Zero. For a given positive integer n, he wants to know the minimum non_negativei 阅读全文
posted @ 2019-04-21 20:08 蓉~ 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Description Tom is the most handsome CCPC contestant in HIT.Tom has a PE exam. So he must run 2400 meters. As we all know, one circle of runways is400 阅读全文
posted @ 2019-04-21 20:06 蓉~ 阅读(245) 评论(0) 推荐(0) 编辑
摘要: The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of 阅读全文
posted @ 2019-04-21 19:44 蓉~ 阅读(145) 评论(0) 推荐(0) 编辑
摘要: people in USSS love math very much, and there is a famous math problem . give you two integers nn ,aa ,you are required to find 22 integers bb ,cc suc 阅读全文
posted @ 2019-04-21 19:42 蓉~ 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 一: 二: 阅读全文
posted @ 2019-04-11 16:14 蓉~ 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 湖中有n块石头,编号从1到n,有两只青蛙,Bob在1号石头上,Alice在2号石头上,Bob想去看望Alice,但由于水很脏,他想避免游泳,于是跳着去找她。但是Alice的石头超出了他的跳跃范围。因此,Bob使用其他石头作为中间站,通过一系列的小跳跃到达她。两块石头之间的青蛙距离被定义为两块石头之间 阅读全文
posted @ 2019-04-09 19:56 蓉~ 阅读(317) 评论(0) 推荐(0) 编辑
摘要: A string is called diverse if it contains consecutive (adjacent) letters of the Latin alphabet and each letter occurs exactly once. For example, the f 阅读全文
posted @ 2019-04-04 15:48 蓉~ 阅读(392) 评论(0) 推荐(0) 编辑
摘要: *Floyd--Warshall 求任意两点间的最短路算法 它的核心算法就只有五行 该算法for循环较多,时间复杂度为0(N^3),数据稍大则会超时,有局限性。 *Dijkstra--单源最短路 指定一个点到其余各顶点的最短路径。 该算法时间复杂度为O(N^2), *Bellman-Ford 解决负 阅读全文
posted @ 2019-04-04 15:36 蓉~ 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Each day in Berland consists of nn hours. Polycarp likes time management. That's why he has a fixed schedule for each day — it is a sequence a1,a2,…,a 阅读全文
posted @ 2019-04-02 18:52 蓉~ 阅读(154) 评论(0) 推荐(0) 编辑