自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 资源 (4)
  • 收藏
  • 关注

转载 二分查找与STL中的lower_bound(),upper_bound(),binary_search()

lower_bound()  lower_bound()是二分查找的一种,在已排序的区间[first,last)中寻找元素value。如果[first,last)中有与value相等的元素,便返回一个迭代器,指向其中第一个元素。如果没有这样的元素存在,便返回“假设这样的元素存在时应该出现的位置”。也就是说,它返回一个迭代器,指向第一个“不小于value”的元素。如果value大于[first,las

2016-04-29 11:10:06 1267

原创 boost::filesystem挖坑待填

boost::filesystem挖坑待填

2016-04-27 15:11:41 374

原创 boost::program_options挖坑待填

boost::program_options挖坑待填

2016-04-27 15:11:13 310

翻译 命名空间别名 Namespace aliases

命名空间别名允许程序员为一个命名空间定义一个替换名称。语法 namespace alias_name = ns_name; (1) namespace alias_name =::ns_name; (2) namespace alias_name = nested_name::ns_name; (3)解释新的别名alias_name为访问ns_name提供了一种

2016-04-27 09:43:07 5855

原创 162. Find Peak Element

ProblemA peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks, in th

2016-04-25 21:17:25 481

原创 275. H-Index II

ProblemFollow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm? Solution看了讨论区,还是没想明白二分查找的判断条件。//没想明白 class Solution {public: int hIndex

2016-04-23 16:27:37 396

原创 274. H-Index

ProblemGiven an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index. According to the definition of h-index on Wikipedi

2016-04-23 16:07:50 367

原创 91. Decode Ways

ProblemA message containing letters from A-Z is being encoded to numbers using the following mapping: ‘A’ -> 1 ‘B’ -> 2 … ‘Z’ -> 26Given an encoded message containing digits, determine the

2016-04-23 15:24:50 397

原创 318. Maximum Product of Word Lengths

ProblemGiven a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower cas

2016-04-23 11:19:03 462

原创 338. Counting Bits

ProblemGiven a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array. Example: For

2016-04-23 10:26:20 338

原创 344. Reverse String

ProblemWrite a function that takes a string as input and returns the string reversed. Example: Given s = “hello”, return “olleh”. Solutionclass Solution {public: string reverseString(string

2016-04-23 09:39:16 518

原创 CUDA简要学习

GPU线程void some_func(int *a,int *b,int *c){ for(int i = 0;i<128;++i) a[i] = b[i] * c[i];}这段代码很简单,在CUDA中,我们可以将这段代码直接转换成用128个线程,每个线程都执行下面这段代码:a[i] = b[i] * c[i];  在CUDA中,可以通过创建一个内核函数的方式,将循环并

2016-04-18 15:50:23 971

原创 216. Combination Sum III

QuestionFind all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.Ensure that numbers

2016-04-13 10:35:33 430

原创 #1039 : 字符消除

时间限制:1000ms 单点时限:1000ms 内存限制:256MB描述小Hi最近在玩一个字符消除游戏。给定一个只包含大写字母”ABC”的字符串s,消除过程是如下进行的:1)如果s包含长度超过1的由相同字母组成的子串,那么这些子串会被同时消除,余下的子串拼成新的字符串。例如”ABCCBCCCAA”中”CC”,”CCC”和”AA”会被同时消除,余下”AB”和”B”拼成新的字符串”ABB”。2)上述

2016-04-05 21:39:15 393

vs2010.vssettings

vs2010.vssettings

2016-04-06

设计模式--design patterns课件

哈工大威海--孙玉山老师的设计模式课件,讲的非常之详细

2011-09-12

Ubuntu下Mentohust的用法

mentohustd的使用,很详细,希望对你有帮助

2011-09-11

空空如也

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

TA关注的人

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