码迷,mamicode.com
首页 >  
搜索关键字:解题报告    ( 2279个结果
LeetCode Intersection of Two Linked Lists 解题报告
LeetCode Intersection of Two Linked Lists 解题报告,求两个链表的第一个公共节点。...
分类:其他好文   时间:2014-12-29 01:12:37    阅读次数:109
【LeetCode】First Missing Positive 解题报告
【题目】 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 should run in O(n) time and use...
分类:其他好文   时间:2014-12-28 22:21:58    阅读次数:242
[Miller-Rabin][CODEVS1702]素数判定2 解题报告
题面描述:判定一个数P∈[1,2^63-1]∩N是素数么。 按照朴素的判定素数方法,至少也需要O(P^0.5)的,但这道题就是霸气到连这样的时间复杂度都过不了的地步。 实在是不会做了,就学习了传说中的Miller-Rabin素数判定法。 两个引理: ①费马小定理: 设p为质数,且不满足p|a, 则a^(p-1)=a(mod p). 证: 又一个引理,若n与p互质,且a与p互质,则n...
分类:其他好文   时间:2014-12-28 22:17:43    阅读次数:182
Leetcode:Edit Distance 解题报告
Edit DistanceGiven two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You...
分类:其他好文   时间:2014-12-28 19:26:42    阅读次数:108
BestCoder24 1001.Sum Sum Sum(hdu 5150) 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5150题目意思:就是直接求素数。 不过 n = 1,也属于答案范围!!只能说,一失足成千古恨啊~~~~~ 1 #include 2 #include 3 #include 4 #include...
分类:其他好文   时间:2014-12-27 21:43:41    阅读次数:258
Leetcode:Interleaving String 解题报告
Interleaving StringGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = ...
分类:其他好文   时间:2014-12-27 21:40:23    阅读次数:326
Leetcode:Scramble String 解题报告
Scramble StringGiven a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible...
分类:其他好文   时间:2014-12-27 21:37:15    阅读次数:192
Leetcode:Longest Substring Without Repeating Characters 解题报告
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ...
分类:其他好文   时间:2014-12-27 20:14:16    阅读次数:214
【原创】leetCodeOj --- Majority Element 解题报告(脍炙人口的找n个元素数组中最少重复n/2次的元素)
题目地址:https://oj.leetcode.com/problems/majority-element/题目内容:Given an array of sizen, find the majority element. The majority element is the element th...
分类:编程语言   时间:2014-12-27 20:13:16    阅读次数:140
Leetcode:【DP】Longest Palindromic Substring 解题报告
Longest Palindromic Substring-- HARD 级别Question SolutionGiven a string S, find the longest palindromic substring in S. You may assume that the maximum...
分类:其他好文   时间:2014-12-27 20:12:16    阅读次数:136
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!