这道题跟coins很像,看来楼教主的男人八题果然不简单。
先按照可到达最高值按升序排序。完后进行coins式的背包处理就好了。
#include
#include
#include
#include
#include
#define max(a,b) ((a)>(b)?(a):(b))
typedef long long ll;
using namespace std;
const i...
分类:
系统相关 时间:
2014-11-10 10:10:50
阅读次数:
224
Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe...
分类:
其他好文 时间:
2014-11-10 06:30:52
阅读次数:
238
Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space. 1 public class Solution { 2 public boolean isPalindrom...
分类:
其他好文 时间:
2014-11-09 23:37:34
阅读次数:
209
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-11-09 19:30:15
阅读次数:
143
Ctrl + Space完成类、方法、变量名称的自动输入,这个快捷键是我最经常使用的快捷键了,它可以完成类、方法、变量名称的自动录入,很方便.(不过在我的电脑上和输入法冲突)Ctrl + N快速跳转到执行的类。Ctrl + Shift + N跳转到指定的文件Ctrl+Shift+Alt+N可以快速打...
分类:
其他好文 时间:
2014-11-09 16:29:42
阅读次数:
1909
[Description] Given a string, find the largest unique substring.e.g. str[] = "asdfghjkkjhgf"; sub[] = "asd";[Thought] create an auxiliary space 'r...
分类:
其他好文 时间:
2014-11-09 11:13:04
阅读次数:
142
各种系统架构图及其简介转载请保留出处,不胜人生一场醉汇总。以下文字和架构图均在本人相关系统设计和架构方案中有所应用。原文出处:http://space.itpub.net/6517/viewspace-6096541.Spring架构图Spring是一个开源框架,是为了解决企业应用程序开发复杂性而创...
分类:
数据库 时间:
2014-11-09 11:08:10
阅读次数:
276
在国内外,业界盛传有十大开源游戏引擎,分别是OGRE、Irrlicht、Panda3D、Crystal Space、jME、Blender Game Engine、Reality Factory、The Nebula Device 2、RealmForge、OpenScene- Graph。我们对这...
分类:
其他好文 时间:
2014-11-09 09:43:49
阅读次数:
197
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ...
分类:
其他好文 时间:
2014-11-09 07:30:45
阅读次数:
155
white-space:nowrap; /* 禁止自动换行 */overflow:hidden; /* 隐藏溢出的内容 */text-overflow:ellipsis; /* 溢出文本使用...代替 */
分类:
Web程序 时间:
2014-11-08 20:47:05
阅读次数:
180