摘要: 相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件, 阅读全文
posted @ 2017-08-06 10:59 山杉三 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Input测试输入包含若干测试用例。每个测试用例的第1行给出 阅读全文
posted @ 2017-08-06 10:51 山杉三 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Josephina is a clever girl and addicted to Machine Learning recently. She pays much attention to a method called Linear Discriminant Analysis, which h 阅读全文
posted @ 2017-08-05 14:43 山杉三 阅读(196) 评论(0) 推荐(0) 编辑
摘要: The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D 阅读全文
posted @ 2017-08-05 09:59 山杉三 阅读(222) 评论(0) 推荐(0) 编辑
摘要: HOHO,终于从Speakless手上赢走了所有的糖果,是Gardon吃糖果时有个特殊的癖好,就是不喜欢将一样的糖果放在一起吃,喜欢先吃一种,下一次吃另一种,这样;可是Gardon不知道是否存在一种吃糖果的顺序使得他能把所有糖果都吃完?请你写个程序帮忙计算一下。 Input第一行有一个整数T,接下来 阅读全文
posted @ 2017-08-05 09:25 山杉三 阅读(128) 评论(0) 推荐(0) 编辑
摘要: The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For e 阅读全文
posted @ 2017-08-05 09:19 山杉三 阅读(152) 评论(0) 推荐(0) 编辑
摘要: The name of one small but proud corporation consists of n lowercase English letters. The Corporation has decided to try rebranding — an active marketi 阅读全文
posted @ 2017-08-05 09:13 山杉三 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 名词解释: 一串数字比如1、5、3、6、9、8、10,它的子序列是从左到右不连续的若干个数,比如1、5、6,3、9、8、10都是它的子序列。 最长上升子序列即从左到右严格增长的最长的一个子序列,1、5、6、9、10就是这个序列的一个最长上升子序列。 给出若干序列,求出每个序列的最长上升子序列长度。 阅读全文
posted @ 2017-08-03 08:36 山杉三 阅读(286) 评论(0) 推荐(0) 编辑
摘要: Emily the entrepreneur has a cool business idea: packaging and selling snowflakes. She has devised a machine that captures snowflakes as they fall, an 阅读全文
posted @ 2017-08-02 15:43 山杉三 阅读(146) 评论(0) 推荐(0) 编辑
摘要: You are one of the competitors of the Olympiad in numbers. The problem of this year relates to beatiful numbers. One integer is called beautiful if an 阅读全文
posted @ 2017-08-02 10:05 山杉三 阅读(90) 评论(0) 推荐(0) 编辑