上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 31 下一页
摘要: 题目 设 f[i] 表示两个质数的和为 i 的方案数,则 a n s = ∑ 1 n f [ i ] × f [ n − i ] ans =\sum_1^n f[i] × f[n − i] ans=∑1n​f[i]×f[n−i]。 注意到 n 以内的质数不超过 $O(\frac{n}{log n}) 阅读全文
posted @ 2018-06-25 23:21 Mingoal 阅读(38) 评论(0) 推荐(0)
摘要: 看了题解,豁然开朗 T T T 的字符集为 1 1 1 时是最优的,因此答案为 26 26 26 个字符出现次数的最小值。 证明:字符集为 1 1 1 时可以使得 L C S LCS LCS 为 26 26 26 个字符出现次数的最小值 而对于任意一个串,它和原串的 L C S LCS LCS 至少 阅读全文
posted @ 2018-06-25 21:43 Mingoal 阅读(24) 评论(0) 推荐(0)
摘要: 题目 题解 #include<bits/stdc++.h> using namespace std; const int M=131072; int a[102][M+103],b[M+103][102],q,x,y,i,j; inline char gc(){ static char buf[10 阅读全文
posted @ 2018-06-22 23:07 Mingoal 阅读(25) 评论(0) 推荐(0)
摘要: 题目 题解 cdq分治+树状数组,这里贴的是2683的代码,1176还要改一下 #include<bits/stdc++.h> using namespace std; const int M=800002,N=500002; struct node{ int fl,x,y,v,pos,id; }a 阅读全文
posted @ 2018-06-22 21:11 Mingoal 阅读(23) 评论(0) 推荐(0)
摘要: 以下我在知道结论后自己证出的三个公式,相互关联的。虽然不难,但还是有一定成就感,顺便学习一下markdown怎么编辑数学公式 markdown数学公式 1.和角公式 ∠ A O B = α ∠AOB=\alpha ∠AOB=α ∠ B O D = β ∠BOD=\beta ∠BOD=β S Δ A 阅读全文
posted @ 2018-06-22 20:34 Mingoal 阅读(56) 评论(0) 推荐(0)
摘要: 题目 题解: 这题我看没有 k−d k − d 树的题解,我就来一发 三维 k−d k − d 树 O(n5/3) O ( n 5 / 3 ) 应该是过不了的,我T掉了5个点 我们可以把 z z 排序,x" role="presentation" style="position: relative; 阅读全文
posted @ 2018-06-22 13:15 Mingoal 阅读(28) 评论(0) 推荐(0)
摘要: 博客1 博客2 阅读全文
posted @ 2018-06-21 20:48 Mingoal 阅读(15) 评论(0) 推荐(0)
摘要: 题目 k-d树 题解 注意:程序中的D是全局变量,用于排序中的比较 #include<cstdio> #include<algorithm> using namespace std; const int N=200002; int n,m,x,y,ans,opt,A,xx,yy,D,i; inlin 阅读全文
posted @ 2018-06-21 17:11 Mingoal 阅读(19) 评论(0) 推荐(0)
摘要: 题目 题解: 第一次做三维空间的题。提交7次,终于A了,感人啊 说一下我的心路历程。 刚开始,我的想法是,把所有空的都标记好,其他的都设为有方块(这部就叫做镂空吧),判断是否可行后灌水,看看联通块个数是否为1 但是,WA了,下载数据后发现,如果把剩下的都设为方块,有可能会多设了方块导致多出一个联通块 阅读全文
posted @ 2018-06-20 22:28 Mingoal 阅读(21) 评论(0) 推荐(0)
摘要: 题目 可参考题解 官方题解: 首先有一部分是必须换的,反正必须换不妨换个彻底,将place最大的与cutoff最大的匹配,place最小的与cutoff最小的匹配。 如果成立就结束。 不成立的话,再试图引入一个外部项,这步贪心即可。 “贪心”这步很关键,在题解的基础上我阐述贪心算法,并说明其正确性 阅读全文
posted @ 2018-06-20 20:33 Mingoal 阅读(16) 评论(0) 推荐(0)
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 31 下一页