自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 [POJ] 3176 Cow Bowling

动态规划#include <iostream>#include <algorithm>using namespace std;int main() { int n; cin >> n; int ** sum = new int*[n]; sum[0] = new int; cin >> sum[0][0]; for (int i = 1; i

2016-06-30 20:36:27 218

原创 [leetcode]318. Maximum Product of Word Lengths

leetcode318

2016-06-29 13:02:03 213

原创 [leetcode]367. Valid Perfect Square

Given a positive integer num, write a function which returns True if num is a perfect square else False.Note: Do not use any built-in library function such as sqrt.class Solution {public: bool is

2016-06-28 12:11:19 339

原创 [leetcode] 368. Largest Divisible Subset

对于一个排好序的数列nums, nums[i] % nums[j] = 0 且 nums[j] % nums[k] = 0 则有 nums[i] % nums[k] = 0. 因此可以用动态规划: 用maxpos记录该子列的结尾元素下标; 数组num用num[i]记录以nums[i]为结尾元素的满足条件的子列的最大元素个数; 数组index用index[i]记录

2016-06-28 10:24:15 237

原创 Binary Tree

#include <iostream>using namespace std;class BinaryTree { private: struct treenode{ int key; treenode *left, *right; treenode (int k, treenode *l = 0, t

2016-05-25 20:05:40 160

原创 Bubble sort, Insertion sort, merge sort, quick sort, heap sort

#include <iostream>#include <algorithm>#include <cstdlib>#include <ctime>using std::cout;using std::endl;const int n = 80000;// bubblesortvoid bubble(int * a, int n) { for (int i = 0; i < n

2016-05-23 20:44:29 582

空空如也

空空如也

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

TA关注的人

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