摘要: http://poj.org/problem?id=3286求m和n之间有0的数的个数。 把题转换为从0到x中有0的数的个数,count1(n)-count1(m-1)就是从m到n的个数。 1 #include 2 #include 3 #include 4 #include 5 #defi... 阅读全文
posted @ 2014-06-08 19:11 null1019 阅读(185) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1095先求出n个节点数的二叉树的形态有多少种。卡特兰数f[n]=f[n-1]*(4*n-2)/(n+1);再递归求。 1 #include 2 #include 3 #include 4 #define ll long long 5 #de... 阅读全文
posted @ 2014-06-08 18:22 null1019 阅读(172) 评论(0) 推荐(0) 编辑