该文被密码保护。 阅读全文
posted @ 2019-10-24 08:32 Ryn_Honey 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.luogu.org/problem/P1447 答案为 Σ1~nΣ1~m(gcd(i,j)*2-1) = Σ1~nΣ1~m(gcd(i,j)*2)-n*m 考虑 gcd(i,j)的取值为x 记录cnt[x]=n/x * m/x 出现公因数x的对数 g[x]为最大公因数 阅读全文
posted @ 2019-10-31 19:31 Ryn_Honey 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.luogu.org/problem/P2679 这是个鬼的字符串啊,明明是dp好嘛,哼! 本人sb错误原因: dp转移方程不知道为啥,感觉就是这样,然后样例过了。也就过了...... #include<cstdio> #include<algorithm> #incl 阅读全文
posted @ 2019-10-27 21:16 Ryn_Honey 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.luogu.org/problem/P4568 跑个分层图。 有人说数组开小了,RE了,说实话我很蒙蔽。直接用d[i][j]表示到i已用了j条免费通道不就行了吗? #include<cstdio> #include<queue> #include<algorithm> 阅读全文
posted @ 2019-10-27 20:02 Ryn_Honey 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.luogu.org/problem/P1314 本SB犯得错误: 二分参数W,然后前缀和一下,逐个计算检验值Y。 不开longlong见祖宗 不开longlong见祖宗 不开longlong见祖宗 #include<cstdio> #include<cstring> 阅读全文
posted @ 2019-10-27 19:41 Ryn_Honey 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.luogu.org/problem/P5367 刚开始背的式子,一测WAWAWA......(式子背错了..... 然后请教了下大佬。 就考虑比当前排列字典序小的有哪些。 第i个位置,后边剩下n-i个位置没有填,所以(n-i)! 考虑第i个位置,就再乘以( i-ask 阅读全文
posted @ 2019-10-25 07:14 Ryn_Honey 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.luogu.org/problem/P5020 这题刚开始一眼暴力,按着题意来一遍,然后就在某谷AC了...... #include<cstdio> #include<cstring> #include<algorithm> #define R register us 阅读全文
posted @ 2019-10-24 15:43 Ryn_Honey 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.luogu.org/problem/P1063 简单环形区间dp,把区间增大一倍,按照题意转移即可。 #include<cstdio> #include<algorithm> #define R register using namespace std; int n, 阅读全文
posted @ 2019-10-24 15:29 Ryn_Honey 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.luogu.org/problem/P3203 不会LCT,这题分块直接水。 记录一下走几步到下一个块,到下一个块的那个位置。 然后就没了。 #include<cstdio> #include<cmath> #define R register using names 阅读全文
posted @ 2019-10-24 15:19 Ryn_Honey 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.luogu.org/problem/P1941 关于此题,只能说细节吧。 然后转移方程什么的,就很显然了。初始状态f[0][0]记得赋值为极大值,那个状态是不合法滴! //代码真心丑,费时有点长。。。。。 #include<cstdio> #include<algor 阅读全文
posted @ 2019-10-24 11:51 Ryn_Honey 阅读(125) 评论(0) 推荐(0) 编辑