文章分类 -  ACM ICPC

程序设计
摘要:一, 最长递增子序列问题的描述 设L=是n个不同的实数的序列,L的递增子序列是这样一个子序列Lin=,其中k1是对序列L=按递增排好序的序列。那么显然X与L的最长公共子序列即为L的最长递增子序列。这样就把求最长递增子序列的问题转化为求最长公共子序列问题LCS了。 最长公共子序列问题用动态规划的算法可解。设Li=,Xj=,它们分别为L和X的子序列。令C[i,j]为Li与Xj的最长公共子序列... 阅读全文
posted @ 2009-03-28 21:03 sunjian 阅读(1403) 评论(0) 推荐(0)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->/* 2009-01-16 16:24:36 Accepted 1035 15MS 72K 1340 B 一道简单题 给你一个起点,... 阅读全文
posted @ 2009-01-16 16:32 sunjian 阅读(702) 评论(3) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-29 10:36:18 Accepted 1040 0MS 0K 820 B 排序题 直接调用sort函数是最快的(不要加比较函数,不然也... 阅读全文
posted @ 2008-12-29 10:48 sunjian 阅读(405) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-28 20:57:43 Accepted 1710 78MS 0K 825 B 树的遍历 给你一棵树的先序遍历结果和中序遍历的结果,让... 阅读全文
posted @ 2008-12-28 21:13 sunjian 阅读(365) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-27 20:57:36 Accepted 1071 0MS 0K 1090 B 给你一条抛物线和一条直线,用积分求面积 */ #include #... 阅读全文
posted @ 2008-12-27 21:06 sunjian 阅读(547) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-27 18:17:41 Accepted 1042 4203MS 0K 973 B 大数乘整数 */ #include #define MOD ... 阅读全文
posted @ 2008-12-27 19:04 sunjian 阅读(399) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-27 10:04:05 Accepted 1019 0MS 0K 428 B 求最小公倍数,用欧几里德辗转相除法求出最大公约数,再求出最小公倍数 ... 阅读全文
posted @ 2008-12-27 10:07 sunjian 阅读(325) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-26 22:03:47 Accepted 1018 687MS 0K 277 B 位数=log10(N!)=log10(N)+log10(N-1)... 阅读全文
posted @ 2008-12-26 22:09 sunjian 阅读(418) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-26 20:32:58 Accepted 1016 406MS 0K 846 B 一道简单的DFS搜索题 用数字绕成一个环,邻接的两个数之... 阅读全文
posted @ 2008-12-26 20:52 sunjian 阅读(622) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-26 18:32:43 Accepted 1015 31MS 0K 1171 B 一道简单题 A=1, B=2, , Z=26 ... 阅读全文
posted @ 2008-12-26 18:49 sunjian 阅读(313) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 为什么?…… 这题我做了好久好久…… 估计是输入的问题,但是我哪里错了呢?…… 最后看了人家的输入才A掉 */ #include #define N... 阅读全文
posted @ 2008-12-26 09:39 sunjian 阅读(428) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-22 18:52:06 Accepted 1592 0MS 280K 588B 后来我就改了一下LEN和N(改回初始状态了),结果时间就要15ms了... 阅读全文
posted @ 2008-12-22 19:19 sunjian 阅读(479) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-22 16:27:53 Accepted 2060 0MS 0K 310 B 无语,考英语 WA了一次,题目没看清 */ #includ... 阅读全文
posted @ 2008-12-22 16:32 sunjian 阅读(194) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-21 21:58:16 Accepted 1102 31MS 0K 861 B prim算法球最短路径 感觉题目有点问题,这个算法也不是很... 阅读全文
posted @ 2008-12-21 22:17 sunjian 阅读(180) 评论(0) 推荐(0)
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-21 14:55:18 Accepted 1022 0MS 0K 879 B 这是一道比较简单的题,主要用到的栈的知识 我的思路是这样的: ... 阅读全文
posted @ 2008-12-21 15:36 sunjian 阅读(234) 评论(0) 推荐(0)
摘要:图论算法里的拓扑排序 Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/**//* 2008-12-21 11:28:17 Accepted 1285 125MS 1040K 858 B 简单的拓扑排序 注意:输入... 阅读全文
posted @ 2008-12-21 11:45 sunjian 阅读(345) 评论(0) 推荐(0)
摘要:这道题有个错误就是输入时必须得用gets()或者scanf("%s") Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* HDU2216 15ms 812k */ #include #include #include #de... 阅读全文
posted @ 2008-12-16 21:35 sunjian 阅读(219) 评论(0) 推荐(0)