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 ...
分类:
其他好文 时间:
2014-05-10 20:06:26
阅读次数:
404
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...
分类:
其他好文 时间:
2014-05-05 23:01:41
阅读次数:
374
Problem
Link:http://oj.leetcode.com/problems/longest-consecutive-sequence/This problem
is a classical problem where we can reduce the running time by ...
分类:
其他好文 时间:
2014-05-05 22:55:22
阅读次数:
552
最长公共子系列,简单的dp,不过注意有空格,所以,在读字符串的时候,尽量用gets读,这样基本没问题#include#include#include#includeusing
namespace std;int dp[1001][1001];int MAX(int x,int y){ if (...
分类:
其他好文 时间:
2014-05-04 11:34:41
阅读次数:
294
the longest distance of a binary tree
个人信息:就读于燕大本科软件工程专业 目前大三;
本人博客:google搜索“cqs_2012”即可;
个人爱好:酷爱数据结构和算法,希望将来从事算法工作为人民作出自己的贡献;
博客内容:the longest distance of a binary tree;
博客时间:2014-4-...
分类:
其他好文 时间:
2014-05-04 00:28:23
阅读次数:
446
queue for max elem, pop, push
个人信息:就读于燕大本科软件工程专业 目前大三;
本人博客:google搜索“cqs_2012”即可;
个人爱好:酷爱数据结构和算法,希望将来从事算法工作为人民作出自己的贡献;
博客内容:the longest distance of a binary tree;
博客时间:2014-4-15;
编...
分类:
其他好文 时间:
2014-05-03 17:13:09
阅读次数:
406
这就是数论坑的地方了把,有些题目真心偏到你无法想象,需要用到多项式欧几里德求多项式的最大公共多项式
题意:给你n个多项式,问他们有没有共同的根
先分析把,假设有多项式a,b,同时又有多项式k,r,令 a = k*b +r,应题目要求,令解为0,那么a = 0,同时b也要等于0,那么这时候要满足a=b=0 其实 r = 0,这时候就不需要去管k了,有没有发现跟那个扩展欧几里德有点相似的方程,这时...
分类:
其他好文 时间:
2014-05-02 21:46:47
阅读次数:
419
添加 src/*.cpp 到工程, 修改 Directories and Conditionals,
添加 WIN32 UDT_EXPORTSudt.h需要 #pragmalink"Ws2_32.lib"common.cppchannel.cpp#elif
WIN32 --->#elif defin...
分类:
编程语言 时间:
2014-05-02 11:48:57
阅读次数:
471
ElegantWM.WebUI/Application/common/src/Tools.js欢迎大家贡献更多的正则验证规则,目前支持如下:/*****************************************************************//*
VType自定义校验...
分类:
Web程序 时间:
2014-05-02 06:04:30
阅读次数:
346
$sudoyuminstallvim-enhanced<snipped>Transactioncheckerror:file/usr/share/man/man1/vim.1.gzfrominstallofvim-common-2:7.4.179-1.fc20.x86_64conflictswithfilefrompackagevim-minimal-2:7.4.027-2.fc20.x86_64报错,于是我又更新了一下vi试试$sudoyumupdatevim-min..
分类:
其他好文 时间:
2014-05-02 02:55:55
阅读次数:
285