题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5067题目意思:给出一个 n * m 的方格,每一个小方格(大小为1*1)的值要么为 0 要么为一个正整数。规定是正整数的值得方格个数不超过 10 个。现在问从最左上角的点开始,要经过所有正整数的值的点之...
分类:
系统相关 时间:
2014-10-22 14:32:56
阅读次数:
274
题目来源:最近公共祖先·一时间限制:10000ms单点时限:1000ms内存限制:256MB题目描述小Ho最近发现了一个神奇的网站!虽然还不够像58同城那样神奇,但这个网站仍然让小Ho乐在其中,但这是为什么呢?“为什么呢?”小Hi如是问道,在他的观察中小Ho已经沉迷这个网站一周之久了,甚至连他心爱的...
分类:
其他好文 时间:
2014-10-22 08:44:53
阅读次数:
192
Populating Next Right Pointers in Each Node IIFollow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any ...
分类:
其他好文 时间:
2014-10-21 21:09:42
阅读次数:
267
Populating Next Right Pointers in Each Node TotalGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next...
分类:
其他好文 时间:
2014-10-21 21:06:24
阅读次数:
247
Word SearchGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, wh...
分类:
其他好文 时间:
2014-10-21 17:05:25
阅读次数:
253
Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents yo...
分类:
其他好文 时间:
2014-10-21 12:11:42
阅读次数:
222
Q:Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0]return 3,and [3,4,-1,1]return 2.Your algorithm sho...
分类:
其他好文 时间:
2014-10-20 20:47:32
阅读次数:
231
解题报告题意:原本区间1到n都是1,区间成段改变成一个值,求最后区间1到n的和。思路:线段树成段更新,区间去和。#include #include #include using namespace std;int sum[500000],lz[500000];void push_up(int roo...
分类:
其他好文 时间:
2014-10-20 20:46:57
阅读次数:
217
杨辉三角,分别求前n行和第n行。
【求杨辉三角前n行】
Given numRows, generate the first numRows of Pascal's triangle.
For example, given numRows = 5,
Return
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,...
分类:
其他好文 时间:
2014-10-20 19:32:35
阅读次数:
190
Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example,...
分类:
其他好文 时间:
2014-10-20 18:53:45
阅读次数:
236