摘要:
分析 简单递归模拟即可 注意转向 代码 cpp include include define int long long using namespace std; int t,n,a,b; int city(int k,int p,int& x,int& y){//2^2k,标号为 p 时的房屋的坐 阅读全文
posted @ 2019-06-15 08:22
Sshwy
阅读(145)
评论(0)
推荐(0)
摘要:
摘要 题意:一个 n 个点 m 条边的无向图 $n\equiv 0(\bmod 3)$,保证存在一个大小为 $\frac{2}{3}n$ 的团,要求输出一个大小为 $\frac{1}{3}n$ 的团.$n\leq 3000$. <! more 这道题的特殊之处在于找团,而它保证有一个 $\frac{ 阅读全文
posted @ 2019-06-15 08:21
Sshwy
阅读(263)
评论(0)
推荐(0)
摘要:
按题意模拟即可 关于题意 语法的检查是在整个程序执行前先进行的,因此即使在无法进入的循环中(x y),变量名也不能重名 输入的数据要读完,不要中途 break(如果一边检查语法一边判断复杂度) 代码实现 阅读全文
posted @ 2019-06-15 08:19
Sshwy
阅读(206)
评论(0)
推荐(0)
摘要:
分析 相同大小箱子个数最多的即为答案 然后从大到小依次填充 ans 个序列即可 代码 cpp include include include include using namespace std; const int N=10006; int n,a[N],mx,p,dfn; struct qxx 阅读全文
posted @ 2019-06-15 08:16
Sshwy
阅读(113)
评论(0)
推荐(0)
摘要:
枚举第一行的点击方案。 则点完后剩余的黑灯只能由第二行同一列的点击来弥补 并且第二行除了弥补第一行的黑灯之外,不能点其他灯,否则会使第一行的灯灭 上述构成了递推关系,则递推到最后一行即可。 二进制位运算优化;注意最后一行的状态的判断 复杂度 $O(n2^n),n=5$. 代码 阅读全文
posted @ 2019-06-15 08:15
Sshwy
阅读(91)
评论(0)
推荐(0)
摘要:
暴力枚举油滴的编号的排列(next_permutation),然后按序一个一个扩展。面积的求最小值即可。也可以深搜。 复杂度 $O(n!\times n^2)$. cpp include include include define sq(a) ((a) (a)) define PI 3.14159 阅读全文
posted @ 2019-06-15 08:14
Sshwy
阅读(89)
评论(0)
推荐(0)

浙公网安备 33010602011771号