首页 > 2014年02月06日 > 全部分享
背包模版
关于背包DP的文章很多,谷歌百度搜《背包九讲》即可。本文章只放模版。文章统一v代表体积,w代表价值,f代表dp数组,V代表总体积,W代表总价值,均采用滚动数组。答案一般都为f[V]。01背包:void zop(int v, int w) { for(int i = V; i >= v; --i) f...
分类:其他   时间:2014-02-06 16:47:48    收藏:0  评论:0  赞:0  阅读:368
matlab画图
matlab画图
分类:其他   时间:2014-02-06 16:46:08    收藏:0  评论:0  赞:0  阅读:420
MecAnim
【Animator Component】 Any GameObject that has an avatar will also have anAnimatorcomponent, which is the link between the character and its behavior. 只...
分类:其他   时间:2014-02-06 16:44:28    收藏:0  评论:0  赞:0  阅读:610
Merge Two Sorted Lists
1 public class Solution { 2 public ListNode mergeTwoLists(ListNode l1, ListNode l2) { 3 ListNode safe = new ListNode(-1); 4 ListNode pre = safe; 5 whi...
分类:其他   时间:2014-02-06 16:45:18    收藏:0  评论:0  赞:0  阅读:407
Scramble String
Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation...
分类:其他   时间:2014-02-06 16:43:38    收藏:0  评论:0  赞:0  阅读:431
HDU2594 Simpsons’ Hidden Talents 字符串哈希
最近在学习字符串的知识,在字符串上我跟大一的时候是没什么区别的,所以恶补了很多基础的算法,今天补了一下字符串哈希,看的是大一新生的课件学的,以前觉得字符串哈希无非就是跟普通的哈希没什么区别,倒也没觉得有什么特别大的用处,敲一敲才发现其实讲究还是比较多的。哈希冲突是常有的事,换一下mod,换一下进制数...
分类:其他   时间:2014-02-06 16:42:48    收藏:0  评论:0  赞:0  阅读:397
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,...
分类:其他   时间:2014-02-06 16:41:58    收藏:0  评论:0  赞:0  阅读:349
N-Queens II
Now, instead outputting board configurations, return the total number of distinct solutions. 1 public class Solution { 2 public int totalNQueens(int n...
分类:其他   时间:2014-02-06 16:41:08    收藏:0  评论:0  赞:0  阅读:480
我的博客我做主
今天注册了博客园!O(∩_∩)O~在这里将开始我的另一段编程路上的旅程!新的一年,新的自我,新的开始!~~我爱编程!oh~oh~~
分类:其他   时间:2014-02-06 16:40:18    收藏:0  评论:0  赞:0  阅读:254
Multiply Strings
Given two numbers represented as strings, return multiplication of the numbers as a string. 1 public class Solution { 2 public String multiply(String ...
分类:其他   时间:2014-02-06 16:39:28    收藏:0  评论:0  赞:0  阅读:509
hdu3336 Count the string
It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-emp...
分类:其他   时间:2014-02-06 16:38:38    收藏:0  评论:0  赞:0  阅读:475
Search in Rotated Sorted Array II
Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to...
分类:其他   时间:2014-02-06 16:37:48    收藏:0  评论:0  赞:0  阅读:386
Remove Duplicates from Sorted List II
1 public class Solution { 2 public ListNode deleteDuplicates(ListNode head) { 3 if(head==null || head.next==null) 4 return head; 5 ListNode safe = new...
分类:其他   时间:2014-02-06 16:36:58    收藏:0  评论:0  赞:0  阅读:437
Maximum Depth of Binary Tree
1 public class Solution {2 public int maxDepth(TreeNode root) {3 if(root==null)4 return 0;5 return Math.max(maxDepth(root.left),maxDepth(root.right))+...
分类:其他   时间:2014-02-06 16:36:08    收藏:0  评论:0  赞:0  阅读:310
Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 1 // We shuould use a static variable in...
分类:其他   时间:2014-02-06 16:35:18    收藏:0  评论:0  赞:0  阅读:328
Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / ...
分类:其他   时间:2014-02-06 16:34:28    收藏:0  评论:0  赞:0  阅读:385
Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl...
分类:其他   时间:2014-02-06 16:33:38    收藏:0  评论:0  赞:0  阅读:335
SAP月结操作讲解
1、物料期间关闭只影响到物料的出入库,如果关闭某月份,该月份不能再进行出入库处理,对应的凭证也就不能再进入FI。因为月结前步骤很多,所以这是月结检查的其中一个步骤。以下转载自SAP 方丈的博客http://blog.vsharing.com/SAP100/A723983.htmlSAP月结操作讲解步...
分类:其他   时间:2014-02-06 16:31:58    收藏:0  评论:0  赞:0  阅读:2184
Merge Intervals
Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18]. 1 public clas...
分类:其他   时间:2014-02-06 16:32:48    收藏:0  评论:0  赞:0  阅读:416
Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each number ...
分类:其他   时间:2014-02-06 16:31:08    收藏:0  评论:0  赞:0  阅读:407
376条   上一页 1 ... 6 7 8 9 10 ... 19 下一页
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!