求把N*M的棋盘分割成若干个1*2的的长方形,有多少种方案。 j表示 n 位二进制数 1 表示有“突出” f[i][j]表示当前状态 f[i-1][k]是上一行的状态 if ((j&k)==0&&st[j|k]) f[i][j]+=f[i-1][k]; #include<bits/stdc++.h> ...
实在不知道错哪了。。。 对着 std 检查了好几遍了QAQ 题解见注释(不过估计题解也是错的,不然为什么写错啊QAQ #include<bits/stdc++.h> using namespace std; const int N=1<<16; int m,n,a,b; double pr[N],s ...
分类:
其他好文 时间:
2020-12-24 11:31:40
阅读次数:
0
/*Hatsune Miku 4ever!*/ #include <bits/stdc++.h> using namespace std; typedef long long ll; #define _for(i,a,b) for(int i = (a);i < b;i ++) #define _r ...
分类:
其他好文 时间:
2020-12-23 11:47:45
阅读次数:
0
/*Hatsune Miku 4ever!*/ #include <bits/stdc++.h> using namespace std; typedef long long ll; #define _for(i,a,b) for(int i = (a);i < b;i ++) #define _r ...
分类:
编程语言 时间:
2020-12-23 11:45:22
阅读次数:
0
/*Hatsune Miku 4ever!*/ #include <bits/stdc++.h> using namespace std; typedef long long ll; #define _for(i,a,b) for(int i = (a);i < b;i ++) #define _r ...
分类:
其他好文 时间:
2020-12-23 11:43:21
阅读次数:
0
把冰块拆点来保证企鹅起跳的限制,对于所有点为汇点跑一边最大流看看是不是和企鹅人数相等 #include<bits/stdc++.h> #define FT(a,b) memset(a,b,sizeof(a)) using namespace std; const int N = 300 + 10 , ...
分类:
其他好文 时间:
2020-12-17 12:05:40
阅读次数:
3
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 100005; struct node{ int pre, to, val; }edge[MAXN << 1]; int n, h ...
分类:
其他好文 时间:
2020-12-16 11:41:51
阅读次数:
3
L2-1 简单计算器 (25分) 这个题会用栈就能做出来了。按题目要求写就行,比赛没做全对。 #include<bits/stdc++.h>#define ll long longusing namespace std;int main(){ stack<int>s1; stack<char>s2; ...
分类:
其他好文 时间:
2020-12-11 11:38:53
阅读次数:
2
初一看,sb题,上去一个并查集,很快啊,返回一个MLE,定睛一看,系统开的内存很小,但是这个算法复杂度又是这么正确 因此考虑优化内存,这样用滚动数组优化即可 #include<bits/stdc++.h> using namespace std; typedef long long ll; type ...
分类:
其他好文 时间:
2020-12-10 11:39:56
阅读次数:
13
题意: 一个凸多边形和$m$个光源,问最少选择几个光源使得多边形所有边都被照亮 思路: 对于每个光源,处理出能照到的边,即为区间完全覆盖问题,但是区间是环形的,枚举起点处理 #include <bits/stdc++.h> using namespace std; typedef long long ...
分类:
其他好文 时间:
2020-12-10 11:38:18
阅读次数:
15