随笔分类 -  数学

摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #define rre(i,r,l) for(int i=(r);i>=(l)... 阅读全文
posted @ 2016-03-28 22:36 HugeGun 阅读(344) 评论(0) 推荐(1)
摘要:题目链接 先算在n*m个点中任选3个的方案数,再减去三点共线的方案数 我为什么要做这种水题?因为我很弱 1 #include<algorithm> 2 #include<iostream> 3 #include<cstdlib> 4 #include<cstring> 5 #include<cstd 阅读全文
posted @ 2016-03-07 07:42 HugeGun 阅读(197) 评论(0) 推荐(0)
摘要:题目链接 exgcd 已知a,b求一组正整数解x,y使得ax+by=gcd(a,b); 我为什要做这样的水题?因为我很弱 1 #include<iostream> 2 #include<cstdio> 3 #include<cstdlib> 4 #include<string> 5 #include 阅读全文
posted @ 2016-03-06 21:01 HugeGun 阅读(150) 评论(0) 推荐(0)
摘要:Gerw说凸多边形的三角剖分是一棵树,并且可以转二叉树,因此卡特兰数可以…… 发现一条边只能连接两个三角形,所以可以把三角形当做树的结点,相邻的连边 求证:连接两个三角形的线段经过的三角形等同于树上两个三角形路径上的所有点 我想说,证明好麻烦啊。。。不过还是想表达一下我的看法。。。 首先,题目说(一 阅读全文
posted @ 2016-02-26 14:36 HugeGun 阅读(663) 评论(0) 推荐(0)
摘要:题目链接 好久没写高精度了,调了很久QAQ 如果直接递归计算答案的话肯定会T 发现一个数不管是分成一奇一偶还是直接>>1,都会重复计算很多东西 我们只需要在递归的时候实时维护一个xx(ans[x])和xxx(ans[x-1]) 一层一层的选择更新xx或xxx就好 (请无视递归函数的名称和里面乱搞的数 阅读全文
posted @ 2016-02-26 13:53 HugeGun 阅读(230) 评论(0) 推荐(0)