码迷,mamicode.com
首页 >  
搜索关键字:解题报告    ( 2279个结果
【LeetCode】Longest Consecutive Sequence 解题报告
【题目】 Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence i...
分类:其他好文   时间:2015-01-04 23:07:30    阅读次数:233
LeetCode: Valid Parentheses 解题报告
Valid ParenthesesGiven a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must clos...
分类:其他好文   时间:2015-01-04 22:44:54    阅读次数:263
LeetCode: First Missing Positive 解题报告
First Missing PositiveGiven an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Yo...
分类:其他好文   时间:2015-01-03 23:39:20    阅读次数:166
LeetCode: Best Time to Buy and Sell Stock II 解题报告
Best Time to Buy and Sell Stock IIQuestion SolutionSay you have an array for which the ith element is the price of a given stock on day i.Design an al...
分类:其他好文   时间:2015-01-03 19:45:09    阅读次数:140
LeetCode: Best Time to Buy and Sell Stock III 解题报告
Best Time to Buy and Sell Stock IIIQuestion SolutionSay you have an array for which the ith element is the price of a given stock on day i.Design an a...
分类:其他好文   时间:2015-01-03 19:43:30    阅读次数:171
LeetCode: Best Time to Buy and Sell Stock 解题报告
Best Time to Buy and Sell StockSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to compl...
分类:其他好文   时间:2015-01-03 19:43:30    阅读次数:205
codeforces 500B.New Year Permutation 解题报告
题目链接:http://codeforces.com/problemset/problem/500/B题目意思:给出一个含有 n 个数的排列:p1, p2, ..., pn-1, pn。紧接着是一个 n * n 的矩阵A,当且仅当 Aij = 1 时,pi 与 pj 可以交换数值。现在问如何交换数值...
分类:其他好文   时间:2015-01-03 17:18:48    阅读次数:162
LeetCode: Construct Binary Tree from Inorder and Postorder Traversal 解题报告
Construct Binary Tree from Inorder and Postorder TraversalGiven inorder and postorder traversal of a tree, construct the binary tree.Note:You may assu...
分类:其他好文   时间:2015-01-03 17:18:44    阅读次数:136
[COGS1862]种树 解题报告
【问题描述】 A城市有一个巨大的圆形广场,为了绿化环境和净化空气,市政府决定沿圆形广场外圈种一圈树。园林部门得到指令后,初步规划出n个种树的位置,顺时针编号1到n。并且每个位置都有一个美观度Ai,如果在这里种树就可以得到这Ai的美观度。但由于A城市土壤肥力欠佳,两棵树决不能种在相邻的位置(i号位置和i+1号位置叫相邻位置。值得注意的是1号和n号也算相邻位置!)。 最终市政府给园林部门提供了m棵...
分类:其他好文   时间:2015-01-03 16:00:49    阅读次数:163
Lintcode:Longest Common Subsequence 解题报告
Longest Common SubsequenceGiven two strings, find the longest comment subsequence (LCS).Your code should return the length of LCS.样例For "ABCD" and "ED...
分类:其他好文   时间:2015-01-03 15:55:06    阅读次数:177
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!