自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 leetcode - Largest Rectangle in Histogram

class Solution {public: int largestRectangleArea(vector<int>& heights) { int result = 0; stack<int> s; heights.push_back(0); for (int i = 0; i < heights.size(); ++i

2016-06-10 19:41:12 170

原创 leetcode - Best Time to Buy and Sell Stock IV

class Solution {public: int maxProfit(int k, vector<int>& prices) { if (k == 0 || prices.empty()) { return 0; } if (k > prices.size()/2) return help(prices);

2016-06-10 10:57:37 287

原创 leetcode - Best Time to Buy and Sell Stock III

class Solution {public: int maxProfit(vector<int>& prices) { if (prices.size() <= 1) return 0; vector<int> left(prices.size(), 0); vector<int> right(prices.size(), 0);

2016-06-07 23:42:33 166

原创 leetcode - Best Time to Buy and Sell Stock II

class Solution {public: int maxProfit(vector<int>& prices) { int result = 0; for (int i = 1; i < prices.size(); ++i) { if (prices[i] > prices[i-1]) { re

2016-06-07 22:55:07 175

原创 leetcode - Best Time to Buy and Sell Stock

class Solution {public: int maxProfit(vector<int>& prices) { if (prices.empty()) return 0; int min_price = prices[0]; int result = 0; for (int i = 1; i < prices.siz

2016-06-07 22:54:05 192

原创 trick-交换数字

a=(a=a^b)^(b=a^b)利用 a^a=0

2016-06-07 21:51:04 194

原创 leetcode - Jump Game II

class Solution {public: int jump(vector<int>& nums) { vector<int> f(nums.size(), nums.size()); f[0] = 0; for (int i = 0; i < nums.size(); ++i) { for (int j = i+

2016-06-07 21:43:21 149

原创 leetcode - Jump Game

class Solution {public: bool canJump(vector<int>& nums) { if (nums.empty()) return false; vector<bool> accessibility(nums.size(), false); accessibility[0] = true; f

2016-06-07 19:55:08 157

空空如也

空空如也

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

TA关注的人

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