随笔分类 -  组合数学

1 2 下一页

ACM学习历程—51NOD 1412 AVL树的种类(递推)
摘要:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1770 这是这次BSG白山极客挑战赛的B题。设p(i, j)表示节点个数为i,高度为j的AVL树的个数。 那么,对于1 <= k <= i-1 p[i][j] += p[k] 阅读全文

posted @ 2016-05-24 16:10 AndyQsmart 阅读(742) 评论(0) 推荐(0)

ACM学习历程—2016"百度之星" - 资格赛(Astar Round1)
摘要:http://bestcoder.hdu.edu.cn/contests/contest_show.php?cid=690 A题: 给定字符串,求任意区间的Hash值。 根据题目给定的Hash方式,属于乘法类型,那么就可以预处理出所有的乘法前缀,然后利用逆元,就可以得到任意区间的Hash值。 不过在 阅读全文

posted @ 2016-05-17 18:08 AndyQsmart 阅读(276) 评论(0) 推荐(0)

ACM学习历程—SNNUOJ1213 加油站问题(动态规划 || 数学)
摘要:题目链接:http://219.244.176.199/JudgeOnline/problem.php?id=1213 这是这次微软实习面试的一道题,当时只相出了一个2n的做法,面试官让我优化成n的做法。不过当时没想出来,最后面试官提示到了最后才恍然大悟。 题目大意就是在一个环上有n个加油站,已知第 阅读全文

posted @ 2016-05-04 22:13 AndyQsmart 阅读(1151) 评论(0) 推荐(0)

ACM学习历程—广东工业大学2016校赛决赛-网络赛E 积木积水(最值问题 || 动态规划)
摘要:题目链接:http://gdutcode.sinaapp.com/problem.php?cid=1031&pid=4 这个题目自然会考虑到去讨论最长或者最短的板子。 笔上大概模拟一下的话,就会知道,假设最长的板子是r,0和n+1位置上都是高度为0的板子,那么对于[0, r-1]中的最长板子rr,r 阅读全文

posted @ 2016-04-10 20:14 AndyQsmart 阅读(404) 评论(0) 推荐(0)

ACM学习历程—广东工业大学2016校赛决赛-网络赛C wintermelon的魔界寻路之旅(最短路 && 递推)
摘要:题目链接:http://gdutcode.sinaapp.com/problem.php?cid=1031&pid=2 题目由于要找对称的路径,那么狠明显可以把右下角的每一块加到左上角对应的每一块上。然后就变成从左上角走到对角线的最短路径的个数。 先跑一遍最短路径得到p(i, j)从起点到(i, j 阅读全文

posted @ 2016-04-10 19:54 AndyQsmart 阅读(423) 评论(0) 推荐(0)

ACM学习历程—Hihocoder 1290 Demo Day(动态规划)
摘要:http://hihocoder.com/problemset/problem/1290 这题是这次微软笔试的第三题,过的人比第一题少一点,这题一眼看过去就是动态规划,不过转移方程貌似不是很简单,调试了比较久才正确,不过好在是1A,但是最后只留了一个小时多一点给B题,也导致了B题最后也没能AC掉。首 阅读全文

posted @ 2016-04-09 13:24 AndyQsmart 阅读(594) 评论(5) 推荐(0)

ACM学习历程—BestCoder Round #75
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5640 这题有点辗转相除的意思。基本没有什么坑点。 代码:   http://acm.hdu.edu.cn/showproblem.php?pid=5641 这题坑点有点多,3A。。首先任意一条连线,需要判断中间有 阅读全文

posted @ 2016-03-12 22:12 AndyQsmart 阅读(324) 评论(0) 推荐(0)

ACM学习历程—UVALive 7147 World Cup(分类讨论 && 贪心)
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=5159题目大意是就是n个人进行两两的比赛,胜一局得A分,平局B分,败局C分。然后取... 阅读全文

posted @ 2015-12-07 19:58 AndyQsmart 阅读(549) 评论(0) 推荐(0)

ACM学习历程—UESTC 1217 The Battle of Chibi(递推 && 树状数组)(2015CCPC C)
摘要:题目链接:http://acm.uestc.edu.cn/#/problem/show/1217题目大意就是求一个序列里面长度为m的递增子序列的个数。首先可以列出一个递推式p(len,i)=sum(p(len-1,j))(a[j]#include #include #include #include... 阅读全文

posted @ 2015-11-26 13:58 AndyQsmart 阅读(439) 评论(0) 推荐(0)

ACM学习历程—HDU1041 Computer Transformation(递推 && 大数)
摘要:DescriptionAsequenceconsistingofonedigit,thenumber1isinitiallywrittenintoacomputer.Ateachsuccessivetimestep,thecomputersimultaneouslytranformseachdigi... 阅读全文

posted @ 2015-11-01 20:35 AndyQsmart 阅读(462) 评论(0) 推荐(0)

ACM学习历程—HDU1023 Train Problem II(递推 && 大数)
摘要:DescriptionAsweallknowtheTrainProblemI,thebossoftheIgnatiusTrainStationwanttoknowifallthetrainscomeinstrict-increasingorder,howmanyordersthatallthetra... 阅读全文

posted @ 2015-11-01 20:02 AndyQsmart 阅读(201) 评论(0) 推荐(0)

ACM学习历程—BNUOJ3685 Building for UN(构造)
摘要:The United Nations has decided to build a new headquarters in Saint Petersburg, Russia. It will have a form of a rectangular parallelepiped and will c... 阅读全文

posted @ 2015-10-05 21:12 AndyQsmart 阅读(192) 评论(0) 推荐(0)

ACM学习历程—HDU5490 Simple Matrix (数学 && 逆元 && 快速幂) (2015合肥网赛07)
摘要:Problem DescriptionAs we know, sequence in the form ofan=a1+(n−1)dis called arithmetic progression and sequence in the form ofbn=b1qn−1(q>1,b1≠0)is ca... 阅读全文

posted @ 2015-09-27 22:38 AndyQsmart 阅读(625) 评论(4) 推荐(0)

ACM学习历程—HDU 5459 Jesus Is Here(递推)(2015沈阳网赛1010题)
摘要:Sample Input956781131205199312199401201314Sample OutputCase #1: 5Case #2: 16Case #3: 88Case #4: 352Case #5: 318505405Case #6: 391786781Case #7: 133875... 阅读全文

posted @ 2015-09-19 20:34 AndyQsmart 阅读(410) 评论(3) 推荐(0)

ACM学习历程—ZOJ 3777 Problem Arrangement(递推 && 状压)
摘要:DescriptionThe 11th Zhejiang Provincial Collegiate Programming Contest is coming! As a problem setter, Edward is going to arrange the order of the pro... 阅读全文

posted @ 2015-09-09 18:02 AndyQsmart 阅读(171) 评论(0) 推荐(0)

ACM学习历程—ZOJ3777 Problem Arrangement(递推 && 状压)
摘要:DescriptionThe 11th Zhejiang Provincial Collegiate Programming Contest is coming! As a problem setter, Edward is going to arrange the order of the pro... 阅读全文

posted @ 2015-08-27 10:46 AndyQsmart 阅读(422) 评论(0) 推荐(0)

ACM学习历程—HDU2068 RPG的错排(组合数学)
摘要:Description今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;..... 阅读全文

posted @ 2015-08-25 09:46 AndyQsmart 阅读(378) 评论(0) 推荐(0)

ACM学习历程—HDU1028 Ignatius and the Princess III(递推 || 母函数)
摘要:Description "Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says. "The second problem is, give... 阅读全文

posted @ 2015-08-19 16:41 AndyQsmart 阅读(208) 评论(0) 推荐(0)

ACM学习历程—HDU5396 Expression(递推 && 计数)
摘要:ProblemDescriptionTeacherMaihasnnumbersa1,a2,⋯,anandn−1operators("+","-"or"*")op1,op2,⋯,opn−1,whicharearrangedintheforma1op1a2op2a3⋯an.Hewantstoerasen... 阅读全文

posted @ 2015-08-19 13:53 AndyQsmart 阅读(311) 评论(0) 推荐(0)

ACM学习历程—SNNUOJ 1116 A Simple Problem(递推 && 逆元 && 组合数学 && 快速幂)(2015陕西省大学生程序设计竞赛K题)
摘要:DescriptionAssuming a finite – radius “ball” which is on an N dimension is cut with a “knife” of N-1 dimension. How many pieces will the “ball” be cut... 阅读全文

posted @ 2015-06-12 12:00 AndyQsmart 阅读(288) 评论(1) 推荐(0)

1 2 下一页

导航