自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 收藏
  • 关注

原创 House Robber[leetcode]题解 c++

Leetcode Problem --House Robber c++ 题解 附题意、状态转移方程和c++解题代码

2015-06-21 21:24:39 677

原创 Remove Linked List Elements

Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5Credits:Special than

2015-06-04 20:11:20 430

原创 Isomorphic Strings [LeetCode]

Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with anot

2015-06-03 21:01:29 480

转载 C++new的用法

“new”是C++的一个关键字,同时也是操作符。关于new的话题非常多,因为它确实比较复杂,也非常神秘,下面我将把我了解到的与new有关的内容做一个总结。new的过程当我们使用关键字new在堆上动态创建一个对象时,它实际上做了三件事:获得一块内存空间、调用构造函数、返回正确的指针。当然,如果我们创建的是简单类型的变量,那么第二步会被省略。假如我们定义了如下一个类A:clas

2015-06-02 23:24:37 568

原创 Reverse Linked List[LeetCode]

Reverse a singly linked list.click to show more hints.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?题目要求:反转单链表通过在反转过程中保存临时节点的方式对链表进行反转遇

2015-06-02 23:14:05 362

原创 Count Primes [leetcode]

Description:Count the number of prime numbers less than a non-negative number, n.Credits:Special thanks to @mithmatt for adding this problem and creating all test cases.Hint:Le

2015-06-02 00:37:17 477

原创 vim 常用快捷键

1.:sy on 语法高亮2.:set go =  (set gui option = nothing)3.:colo evening4. tabnew :d\test.txt (Open a new file)5.set go =e6. :w (save) 光标移动指令 1. h 左2. l 右3. k 上4. j

2015-05-24 22:57:35 386

转载 android uri简介

就Android平台而言,URI主要分三个部分:scheme, authority and path。其中authority又分为host和port。格式如下:scheme://host:port/path举个实际的例子:content://com.example.project:200/folder/subfolder/etc\---------/  \-------------

2014-12-09 15:01:14 432

转载 android中的请求码和结果码

在Android中,当Activity之间相互跳转时,可以使用意图(Intent)来传递相应的数据。新的Activity与主Activity不在同一个线程中,当新的Activity关闭时,会触发主Activity的onActivityResult事件。startActivityForResult(Intent intent, int requestCode): 主Activ

2014-11-27 21:45:57 921

原创 poj 1006 Biorhythms 中国剩余定理

题目愿意就是要求出一个Nsh

2014-08-01 13:46:31 554

原创 最大值最小化 二分查找

把一个包含n个正整数的序列划分成m个连续的子序列(每个正整数恰好属于一个序列)。设第i个序列的各数之和为S(i),你的任务是让所有S(i)的最大值尽量小。     例如序列1 2 3 2 5 4 划分成3个序列的最优方案为1 2 3| 2 5| 4,其中S(1)、S(2),S(3)分别为6、7、4最大值为7;     如果划分成1 2 |3 2| 5 4, 则最大值为9,不如刚才好。n #incl

2014-03-24 16:55:50 925

原创 循环日程表问题 通过递归实现

通过递归实现循环日程表#include #include #include #include #include #include #include #include #include #include #include #include #define MAX 10000using namespace std;int bound[MAX][M

2014-03-24 15:01:14 787

空空如也

空空如也

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

TA关注的人

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