自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 资源 (2)
  • 收藏
  • 关注

原创 算法概论 习题8.16

题目:EXPERIMENTAL CUISINEInput: n, the number of ingredients to choose from: D,the n*n "discord" matrix; some number p >= 0Output: The maximum number of ingredients we can choose with penalty Sh

2017-07-11 23:47:17 246

原创 303. Range Sum Query - Immutable

题目:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1sumRange(2, 5) -> -1

2017-06-19 20:40:23 265

原创 357. Count Numbers with Unique Digits

题目:Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x n.Example:Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x [11,

2017-06-12 16:17:38 168

原创 494. Target Sum

题目:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol.

2017-06-05 19:26:21 209

原创 96. Unique Binary Search Trees

题目:Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2

2017-05-18 19:34:35 156

原创 343. Integer Break

题目:Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.For example, given n = 2

2017-05-11 19:54:02 150

原创 486. Predict the Winner

题目:Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a playe

2017-05-08 20:22:10 183

原创 523. Continuous Subarray Sum

题目:Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to the multiple of k, that is,

2017-05-02 21:22:56 147

原创 455. Assign Cookies

题目:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum si

2017-04-24 20:27:46 225

原创 55. Jump Game

题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determ

2017-04-16 23:51:48 144

原创 133. Clone Graph

题目:Clone an undirected graph. Each node in the graph contains a label and a list of itsneighbors. OJ's undirected graph serialization:Nodes are labeled uniquely. We use # as a separator fo

2017-04-05 21:12:48 277

原创 399. Evaluate Division

题目:Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If

2017-03-30 19:40:35 152

原创 207. Course Schedule

题目:There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expr

2017-03-21 20:50:28 179

原创 53. Maximum Subarray

题目:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4,-

2017-03-18 20:27:55 211

原创 240. Search a 2D Matrix II

题目:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to right.Integ

2017-03-08 19:22:44 176

原创 169. Majority Element

题目:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋times.You may assume that the array is non-empty and the majority elemen

2017-03-05 23:10:02 151

原创 485. Max Consecutive Ones

这道题主要就是对输入的二进制数组进行判断并输出数组中连续为1的最大长度。题解比较容易,按顺序遍历整个数组,只要对每次数组元素为1就进行计数,当遇到0时,停止计数;当重新遇到1时,就用一个新的变量计数,遇到0时同样停止,然后将前后两次次数变量进行比较,保留较大数;以此类推……解题的代码如下:class Solution {public: int findMaxConsecuti

2017-02-26 11:54:25 156

信息论基础第二版答案

第2章开始 网络上没有信息论基础第二版的完整答案,所以个人就将整个答案扫描成电子版,以供分享。

2018-05-17

AI项目-pacman

使用A*,a-b剪枝等搜索算法,求解吃豆人的一些简单问题。

2017-12-14

空空如也

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

TA关注的人

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