自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

zhengzaishen的博客

小虾米闯江湖

  • 博客(20)
  • 收藏
  • 关注

原创 leetcode作业完成在这个blog //更新于17.1.8

这篇文章或许会作为列表。

2016-08-31 20:01:54 327

原创 一道凑数问题

题目来源:http://blog.csdn.net/ljhandlwt/article/details/75014415 给定n,给定池,求池的子集的和为n的个数。池为2^0,2^0,2^1,2^1…包含任意2的次幂,且每个数都有两份。

2017-11-24 17:41:07 1271

原创 Wannafly挑战赛3 A

给你一个长 n 的序列,m 次查询 每次查询给一个 x,然后: 从序列的最左端 1 开始,每次随机的选择一个右端点 r,如果两个端点间的区间和不超过 x ,就进行一次分割,然后把左端点变成 r + 1, 否则一直随机下去。 问这样分割出来的期望段数 n <= 100000 , m <= 500 , 0 <= a[i] <= 1000 , x <= 100

2017-11-24 16:28:42 153

原创 linux使用与学习

2017-11-22 17:27:55 251 1

原创 Moscow Subregional of NEERC, ACM ICPC 2016-2017 解题报告

挖坑 已过ABEFGHL

2017-05-01 01:54:19 880 2

原创 POJ专项——解题报告

这个是参考业界广为流传的

2017-05-01 01:53:09 287

原创 生成树专题

深坑

2017-05-01 01:49:58 246

原创 算法概论8.12 K-生成树问题

Problem Description 8.12-K生成树问题: 给定K大于等于2,给出无向图G=(V,E),寻找G的一个生成树,其中保证树上任意点度不超过k,或告知不存在这样的生成树。 题目a:k-生成树问题是一个搜索问题。 题目b:k-生成树问题是NP-完全的。(提示:由k=2开始,考虑与Rudrata路径问题的关联) Solution 题目a: 给出一个G的待确定生成树,枚举每个节点是否

2017-01-08 17:17:36 430

原创 LeetCode #324 Wiggle Sort II

Problem Description Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]…. Example: (1) Given nums = [1, 5, 1, 1, 6, 4], one possible answer is [1, 4, 1, 5, 1, 6].

2017-01-08 14:06:18 194

原创 LeetCode #310 Minimum Height Trees

Problem DescriptionFor a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible rooted trees, those with minimum heig

2017-01-08 02:59:07 218

原创 LeetCode #309 Best Time to Buy and Sell Stock with Cooldown

Problem DescriptionSay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you li

2017-01-08 01:57:15 202

原创 LeetCode #403 Frog Jump

Problem Description A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.

2017-01-07 22:37:06 264

原创 LeetCode #2#3#5#6#7

2 Add Two NumbersSolution: 指针的简单操作 3 Longest Substring Without Repeating CharactersSolution: 开个bool数组记录下每个字符最晚出现的时间点a[s[i]],开个变量作为前一次冲突出现的时间戳k,扫一遍整个串边维护边更新最优值就好了ans=max(ans,i-max(a[s[i]],k-1)。O(n) 5

2017-01-07 21:31:51 274

原创 Leetcode #42 #407 Solution

Problem Description Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to trap after raining. Note: Both

2016-10-19 22:18:26 237

原创 Leetcode #8 Solution

Leetcode #8 Solution

2016-10-08 00:26:49 233

原创 leetcode #1 #15 #16 #18 #167 K-Sum Problem Solution

Problem Description Given an array S of n integers, are there any k elements in S such that a[1]+a[2]+..+a[k] = target? Find all unique quadruplets in the array which gives the sum of target. Some Det

2016-09-28 01:02:50 250

原创 Leetcode #65 Solution

Leetcode #65 Solution

2016-09-14 12:28:58 226

原创 Leetcode #9 Discussion: Only one integer to solve it.

Leetcode #9 Discussion // Rewrite in Markdown mode. 16/9/13

2016-09-13 20:46:58 323

原创 Leetcode #9 Solution

Leetcode #9 Solution // Rewrite in Markdown mode. 16/9/13

2016-09-13 20:10:05 212

原创 Leetcode #56 #338 #344 #292 #371 Solution

Solution of Leetcode #56 #338 #344 #292 #371.

2016-09-13 01:16:15 219

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除