随笔分类 -  构造

leetcode 667. Beautiful Arrangement II
摘要:Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requ 阅读全文
posted @ 2017-08-29 16:12 Beserious 阅读(224) 评论(0) 推荐(0) 编辑
交错01串
摘要:如果一个01串任意两个相邻位置的字符都是不一样的,我们就叫这个01串为交错01串。例如: "1","10101","0101010"都是交错01串。小易现在有一个01串s,小易想找出一个最长的连续子串,并且这个子串是一个交错01串。小易需要你帮帮忙求出最长的这样的子串的长度是多少。 构造两个交错串然 阅读全文
posted @ 2017-08-23 20:20 Beserious 阅读(321) 评论(0) 推荐(0) 编辑
21. Merge Two Sorted Lists
摘要:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 注意边界,注意边 阅读全文
posted @ 2017-07-18 15:47 Beserious 阅读(128) 评论(0) 推荐(0) 编辑
HDU 5813 Elegant Construction
摘要:Elegant Construction Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 204 Accepted Submission(s): 阅读全文
posted @ 2016-08-09 21:24 Beserious 阅读(218) 评论(0) 推荐(0) 编辑
VK Cup 2016 - Round 1 (Div. 2 Edition) C. Bear and Forgotten Tree 3
摘要:C. Bear and Forgotten Tree 3 time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Bear and 阅读全文
posted @ 2016-03-29 12:42 Beserious 阅读(266) 评论(0) 推荐(0) 编辑
AIM Tech Round (Div. 2) C. Graph and String
摘要:C. Graph and String time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day student Vasy 阅读全文
posted @ 2016-02-17 22:26 Beserious 阅读(324) 评论(0) 推荐(0) 编辑