上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 40 下一页
摘要: 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5155 题意: 给n*m的零一矩阵,问它的左视图和正视图都为全1的所有情况。 题解: n,m不超过50,所以可以跑O(n^4); 另dp[i][j]代表前i行(每一行至少放一个,因为这样就可以只考虑列会 阅读全文
posted @ 2016-05-02 00:45 fenicnn 阅读(216) 评论(0) 推荐(0)
摘要: 题目链接: http://poj.org/problem?id=1971 题意: 二维空间给n个任意三点不共线的坐标,问这些点能够组成多少个不同的平行四边形。 题解: 使用的平行四边形的判断条件:对角线互相平分的四边形是平行四边形。 所以我们枚举每一条线段,如果有两条线段的中点是重合的,那么这四个顶 阅读全文
posted @ 2016-05-01 01:25 fenicnn 阅读(444) 评论(0) 推荐(1)
摘要: 题目: C. Exams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Exams time limit per test 阅读全文
posted @ 2016-04-30 23:18 fenicnn 阅读(252) 评论(0) 推荐(0)
摘要: 题目: E. Arthur and Brackets time limit per test 2 seconds memory limit per test 128 megabytes input standard input output standard output E. Arthur and 阅读全文
posted @ 2016-04-30 23:01 fenicnn 阅读(220) 评论(0) 推荐(0)
摘要: 题目: B. Friends and Presents time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have two 阅读全文
posted @ 2016-04-30 22:41 fenicnn 阅读(283) 评论(0) 推荐(0)
摘要: 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5159 题解: 考虑没一个数的贡献,一个数一次都不出现的次数是(x-1)^b,而总的排列次数是x^b,所以每一个数有贡献的次数都是x^b-(x-1)^b,所以最后推导的公式就是: (x^b-(x-1)^ 阅读全文
posted @ 2016-04-29 22:50 fenicnn 阅读(143) 评论(0) 推荐(0)
摘要: 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5154 题解: 有向图判环。 1、用dfs,正在访问的节点标记为-1,已经访问过的节点标记为1,没有访问过的节点标记为0,如果访问到-1的节点说明说有环。 2、拓扑排序。 阅读全文
posted @ 2016-04-29 22:42 fenicnn 阅读(206) 评论(0) 推荐(0)
摘要: 题目链接: hdu: http://acm.hdu.edu.cn/showproblem.php?pid=5617 bc(中文): http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=666&pid=1003 题解: 阅读全文
posted @ 2016-04-29 01:34 fenicnn 阅读(214) 评论(0) 推荐(0)
摘要: 题目链接: hdu: http://acm.hdu.edu.cn/showproblem.php?pid=5167 题意: 给你一个x,判断x能不能由斐波那契数列中的数相乘得到(一个数可以重复使用) 题解: 1、筛法 首先,小于10^9的斐波那契数很少,就42个(不包括0,1),对于给定的x能同时成 阅读全文
posted @ 2016-04-28 10:35 fenicnn 阅读(410) 评论(0) 推荐(0)
摘要: 题目链接: hdu: http://acm.hdu.edu.cn/showproblem.php?pid=5172 bc(中文): http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=567&pid=1003 题解: 阅读全文
posted @ 2016-04-28 01:09 fenicnn 阅读(270) 评论(0) 推荐(0)
上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 40 下一页