随笔分类 -  算法

摘要:打开题目连接 题意:给2个数组(无序的)啊a,b,判断b数组中的每一个元素大于a数组中个数。 ACcode: lower_bound的详细: 参考链接 vector的详细:参考链接 阅读全文
posted @ 2015-12-19 13:36 lzyer 阅读(244) 评论(0) 推荐(0)
摘要:打开题目链接 题意:输入一个字符串,用,或;分隔输出字符串和整数(不含前导0和浮点数) ACcode: 阅读全文
posted @ 2015-12-19 11:36 lzyer 阅读(192) 评论(0) 推荐(0)
摘要:Problem Statement Let's say you have a binary string such as the following: 011100011 One way to encrypt this string is to add to each digit the sum o 阅读全文
posted @ 2015-10-24 17:36 lzyer 阅读(404) 评论(0) 推荐(0)
摘要:A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde 阅读全文
posted @ 2015-09-25 00:45 lzyer 阅读(216) 评论(0) 推荐(0)
摘要:Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 题解:二进制字符串相加 public String addBinary(String 阅读全文
posted @ 2015-09-23 22:15 lzyer 阅读(207) 评论(0) 推荐(0)
摘要:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F 阅读全文
posted @ 2015-09-23 09:28 lzyer 阅读(123) 评论(0) 推荐(0)
摘要:Majority Element Total Accepted: 58500 Total Submissions: 163658My Submissions Question Solution Majority Element Question Solution Given an array of 阅读全文
posted @ 2015-09-01 16:36 lzyer 阅读(187) 评论(0) 推荐(0)
摘要:Limits Constraints Examples This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of 阅读全文
posted @ 2015-08-30 12:27 lzyer 阅读(200) 评论(0) 推荐(0)
摘要:Bone Collector Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 36479 Accepted Submission(s): 1505 阅读全文
posted @ 2015-05-04 11:22 lzyer 阅读(274) 评论(0) 推荐(0)
摘要:统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 20565 Accepted Submission(s): 8949 Problem 阅读全文
posted @ 2015-04-10 15:24 lzyer 阅读(190) 评论(0) 推荐(0)
摘要:题目链接描述小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。这一天,他们遇到了一本词典,于是小Hi就向小Ho提出了那个经典的问题:“小Ho,你能不能对于... 阅读全文
posted @ 2015-04-10 14:53 lzyer 阅读(237) 评论(0) 推荐(0)
摘要:Description Given a sequence of N nonnegative integers. Let's define the median of such sequence. If N is odd the median is the element with stands in 阅读全文
posted @ 2013-12-16 21:18 lzyer 阅读(354) 评论(0) 推荐(0)
摘要:描述 In a Lotto I have ever played, one has to select 6 numbers from the set {1,2,...,49}. A popular strategy to play Lotto - although it doesn't increa 阅读全文
posted @ 2013-12-14 19:15 lzyer 阅读(285) 评论(0) 推荐(0)
摘要:Greedy Gift Givers A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not 阅读全文
posted @ 2013-12-06 16:08 lzyer 阅读(344) 评论(0) 推荐(0)