随笔分类 -  数学

1
摘要:bzoj1045 洛谷P4016 洛谷P2512 bzoj3293 洛谷P3156 题解:https://www.luogu.org/blog/LittleRewriter/solution-p2512 1 #include<cstdio> 2 #include<algorithm> 3 #incl 阅读全文
posted @ 2018-11-04 19:13 hehe_54321 阅读(171) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2018-11-01 14:34 hehe_54321 阅读(3) 评论(0) 推荐(0)
摘要:https://codeforces.com/problemset/problem/407/C (自用,勿看) 手模一下找一找规律,可以发现,对于一个修改(l,r,k),相当于在[l,r]内各位分别加上[1,0,0,0,0,..]做k+1次前缀和得到的数组 比如(l=3,r=6,k=2),[1,0, 阅读全文
posted @ 2018-10-23 15:38 hehe_54321 阅读(224) 评论(0) 推荐(0)
摘要:http://210.33.19.103/contest/998 and,or部分 并不用01trie,题目&题解:https://blog.csdn.net/dreaming__ldx/article/details/81909133 (奇怪的方法,然而至今没搞明白:https://blog.cs 阅读全文
posted @ 2018-09-17 21:58 hehe_54321 阅读(247) 评论(0) 推荐(0)
摘要:http://210.33.19.103/problem/2174 很显然是矩阵快速幂的题,设有in和ou矩阵,设in矩阵的转置为in' 显然可以直接暴力求出任意两点间走一步路径条数,然后求其d次幂,但是这样子复杂度不对 注意到设任意两点间走一步路径条数的矩阵为A,那么A=ou*in',A^d=(o 阅读全文
posted @ 2018-09-07 20:39 hehe_54321 阅读(397) 评论(0) 推荐(0)
摘要:https://konnyakuxzy.github.io/BZPRO/JudgeOnline/3837.html https://szkopul.edu.pl/problemset/problem/EatNJj4oyss-xkLw0yMmGghb/site/?key=statement 不会。。。 阅读全文
posted @ 2018-08-28 16:44 hehe_54321 阅读(222) 评论(0) 推荐(0)
摘要:卡特兰数:https://blog.csdn.net/wu_tongtong/article/details/78161211 https://www.luogu.org/problemnew/show/P1044 n的答案就是C[n] 证明的话,设n的答案为ans[n],只要考虑最后一个出栈的数( 阅读全文
posted @ 2018-08-27 19:59 hehe_54321 阅读(328) 评论(0) 推荐(0)
摘要:https://www.luogu.org/problemnew/show/P2759 阅读全文
posted @ 2018-07-26 18:21 hehe_54321 阅读(143) 评论(0) 推荐(0)
摘要:https://www.lydsy.com/JudgeOnline/problem.php?id=3209 https://www.luogu.org/problemnew/show/P4317 设cnt(x)为x在二进制下1的个数 很显然,要对于所有k,统计1<=i<=n中cnt(i)==k的i的 阅读全文
posted @ 2018-07-24 22:14 hehe_54321 阅读(192) 评论(0) 推荐(0)
摘要:http://www.tsinsen.com/ViewGProblem.page?gpid=A1339 题解:https://blog.csdn.net/LOI_DQS/article/details/51251737 对着题解A掉了。。。然而并不知道为什么要这么转化问题。。。 复杂度nlog^2n 阅读全文
posted @ 2018-05-11 22:07 hehe_54321 阅读(743) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2018-04-18 22:25 hehe_54321 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2018-04-17 19:00 hehe_54321 阅读(2) 评论(0) 推荐(0)
摘要:https://www.luogu.org/problemnew/show/2822 方法:预处理出2000*2000内所有n和m的答案。 错误原因:递推组合数忘了取模 阅读全文
posted @ 2018-04-04 09:06 hehe_54321 阅读(129) 评论(0) 推荐(0)
摘要:以下这个好像叫高斯约旦消元法,没有回代 https://www.luogu.org/blog/37781/solution-p3389 还可以卡常 #include<cstdio> #include<algorithm> #include<cmath> #define eps 1e-7 using 阅读全文
posted @ 2018-03-22 11:02 hehe_54321 阅读(152) 评论(0) 推荐(0)
摘要:Ignatius and the Princess III HDU - 1028 整数划分问题 假的dp(复杂度不对) 1 #include<cstdio> 2 #include<cstring> 3 typedef long long LL; 4 LL ans[122][122]; 5 LL n, 阅读全文
posted @ 2017-11-08 22:03 hehe_54321 阅读(272) 评论(0) 推荐(0)
摘要:题目 首先,可以确定的是这题的做法就是暴力枚举x,然后去计算方程左边与右边是否相等。 但是noip的D2T3怎么会真的这么简单呢?卡常卡的真是熟练 你需要一些优化方法。 首先可以用秦九韶公式优化一下方程左边的计算方法: 左边=(((..(a[n]*x)+a[n-1])*x+..+a[1])*x+a[ 阅读全文
posted @ 2017-11-05 16:51 hehe_54321 阅读(166) 评论(0) 推荐(0)
摘要:nth Permutation LightOJ - 1060 题意:给定一个小写字母组成的字符串,对其中所有字母进行排列(排列组合的排列),将所有生成的排列按字典序排序,求排序后第n个排列。 方法:按位生成。 首先算出所有字母可以形成的排列总数,如果小于n那么为Impossible。 否则,从第一位 阅读全文
posted @ 2017-10-27 18:54 hehe_54321 阅读(257) 评论(0) 推荐(0)
摘要:Analyzing Polyline CodeForces - 195D 题意:有n个函数,第i个函数yi(x)=max(ki*x+bi,0)。定义函数s(x)=y1(x)+y2(x)+...+yn(x)。显然函数s的图像是一条折线。求折线上有多少个转折点。 方法:对于每一个函数yi(x)的图像,如 阅读全文
posted @ 2017-10-12 08:27 hehe_54321 阅读(253) 评论(0) 推荐(0)
摘要:P1010 幂次方 阅读全文
posted @ 2017-07-13 13:55 hehe_54321 阅读(154) 评论(0) 推荐(0)
摘要:P1017 进制转换 先从正进制开始考虑。 例如二进制: 18=1*2^4+0*2^3+0*2^2+1*2^1+0*2^0=0+2(1+2(0+2(0+2(1)))) k=a[n]*2^n+a[n-1]*2^(n-1)+...+a[0]*2^0=a[0]+2(a[1]+2(...+2(a[n]).. 阅读全文
posted @ 2017-07-13 09:35 hehe_54321 阅读(165) 评论(0) 推荐(0)

1
AmazingCounters.com