摘要: 题目描述: Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and v. Giv 阅读全文
posted @ 2019-03-01 21:38 Hëinz 阅读(215) 评论(0) 推荐(0)
摘要: 题目描述: Lady CA has a tree with n points numbered 1,2,...,n , and each edge has its weight. The unique route connecting two points is called a chain, an 阅读全文
posted @ 2019-03-01 21:31 Hëinz 阅读(202) 评论(0) 推荐(0)
摘要: 题目描述: 给你一个数列, ,`$ maxDist$ $maxDist$`。求满足条件的数列中,k个元素乘积的最大值。 输入 保证数列元素个数不超过 个。 每个元素在 的范围内。 在[1,min(10,数列个数)]的范围内。 在`$[1,50]$`的范围内。 输出 输出最大的乘积 思路: 比较简单的 阅读全文
posted @ 2019-03-01 21:29 Hëinz 阅读(141) 评论(0) 推荐(0)
摘要: 题目描述: 一个理想字符串的定义是 每个字符第一个出现的位置编号就是等于这个字符出现的次数 ,比如 ABOOOB 就是一个理想字符串( A 第一次出现的位置是 1 ,一共有一个 1 , O 最早出现的位置是 3 ,一共有三个 O , B 第一次出现的位置为 2 ,一共有 2 个 B )。给定长度 l 阅读全文
posted @ 2019-03-01 21:28 Hëinz 阅读(197) 评论(0) 推荐(0)
摘要: 题目描述: 令函数 f(x) ( x 为正整数),返回值为 x 的 位数中的最长连续相同的数字长度 ,比如 f(344488)=3,f(123)=1 . 现在给你两个正整数 n 与 k , 要求计算出有多少个位数不大于 n 的数 x 满足 f(x)=k. 返回的答案向 44444444 取模 输入 阅读全文
posted @ 2019-03-01 21:24 Hëinz 阅读(156) 评论(0) 推荐(0)
摘要: 题目描述: Given a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is A[n] , and the right neighbour of A[n] is 阅读全文
posted @ 2019-03-01 21:09 Hëinz 阅读(197) 评论(0) 推荐(0)