- 博客(19)
- 收藏
- 关注
转载 [zz]明月虽好by 王大根 from 豆瓣
豆瓣上一个友邻写的,觉得蛮有意思,而且有些想法跟我不谋而合,转一发~【夏】 夏天的时候,张瑶搬一箱矿泉水上楼。提一口气,顶到胸口,力拔山兮地走上去,啪嗒啪嗒十二步,到楼梯转角,登时气竭,轰隆一声把二十四瓶矿泉水顿下去,整个人撑在箱子上,狗一样喘。 楼下老太太听见动静,探出头来,嗑着瓜子:“哟,姑娘,这么重的东西,怎么不找男朋友过来搬哪?”张瑶不好意思地笑
2015-11-24 21:40:33 641
转载 极限学习机(Extreme Learning Machine)
极限学习机(Extreme Learning Machine) ELM,是由黄广斌提出来的求解神经网络算法。ELM最大的特点是对于传统的神经网络,尤其是单隐层前馈神经网络(SLFNs),ELM比传统的学习算法速度更快。ELM是一种新型的快速学习算法,对于单隐层神经网络,ELM可以随机初始化输入权重和偏置并得到相应的输出权重。对于一个单隐层神经网络,假设有Learning M
2015-11-19 21:16:31 1966 1
原创 STL之next()函数和iota函数
next函数:next(Iterator* it,int n)返回值:指向从it开始的第n个元素的迭代器。示例:next(mylist.begin(),5)iota函数:STL序列依次递增函数iota(Iterator* first,Iterator* last,T val)返回值:无示例:iota (numbers,numbers+
2015-11-16 10:17:41 2307
原创 [60]Permutation Sequence
【题目描述】The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""132"
2015-11-16 10:10:02 283
原创 [69]Sqrt(x)
【题目描述】Implement int sqrt(int x).Compute and return the square root of x.【思路】这道题最直接的思路是采用二分查找方法,但是容易越界,要采用unsigned long long才可以,比较麻烦。使用牛顿迭代法,以本题为例: 计算x2 = n的解,令f(x)=x2-n,相当于求解f(x)
2015-11-15 20:33:20 391
原创 [50]Pow(x, n)
【题目描述】Implement pow(x, n). 【思路】采用递归的思路,需要注意的是要判断边缘样例,如n=0和n=-1的情况,另外当x=0时候要分n等于-1和n不等于-1两种情况讨论。【代码】class Solution {public: double myPow(double x, int n) { double tmp=x;
2015-11-15 20:32:06 405
原创 [273]Integer to English Words
【题目描述】Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.For example,123 -> "One Hundred Twenty Three"12345 -> "Twelve
2015-11-11 21:26:29 255
原创 [213]House Robber II
【题目描述】After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time, all houses at this place are arra
2015-11-09 20:44:49 196
原创 [279]Perfect Squares
【题目描述】Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.For example, given n = 12, return 3 because 12 = 4 + 4 +
2015-11-07 12:40:50 207
原创 [120]Triangle
【题目描述】Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2],
2015-11-06 21:06:03 184
原创 [81]Search in Rotated Sorted Array II
【题目描述】Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a function to determine if a given targ
2015-11-05 22:11:17 165
原创 [33]Search in Rotated Sorted Array
【题目描述】Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the
2015-11-05 21:36:25 164
原创 [89]Gray Code
【题目描述】The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the
2015-11-04 16:12:14 190
原创 [289]Game of Life
【题目描述】According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970."Given a b
2015-11-04 15:53:59 205
原创 [300]Longest Increasing Subsequence
【题目描述】Given an unsorted array of integers, find the length of longest increasing subsequence.For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest increasing subsequence is [2, 3, 7
2015-11-03 20:20:40 186
原创 [275]H-Index II
【题目描述】Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm?【思路】【代码】class Solution {public: int hIndex(vector& citations)
2015-11-02 21:39:45 218
原创 [11]Container With Most Water
【题目描述】Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (
2015-11-02 16:19:46 190
原创 [64]Minimum Path Sum
【题目描述】Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down
2015-11-01 20:04:26 187
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人