摘要: #include using namespace std; #define ULL unsigned long long #define LL long long const LL mod=998244353; const int maxn=20+10; const int n=24; int r[maxn]; int b[maxn]; struct edge{int u,v,w;}; vec... 阅读全文
posted @ 2018-11-08 21:17 BIack_Cat 阅读(121) 评论(0) 推荐(0) 编辑
摘要: POJ 2226 比这题难一点在于它要求覆盖的行或者列只能覆盖*不能覆盖到.我们同样可以构造二分图,对于原图中的每一个'*'都可以把它当做一条边,连接的是它所在*联通列的最上一点,和它所在*联通行的最左一点这样求出来的最小覆盖的点集中的点 如果在二分图左边的就是覆盖该点所在列,在二分图右边则覆盖该点所在行#include #include #include #include #includ... 阅读全文
posted @ 2018-11-03 17:39 BIack_Cat 阅读(270) 评论(0) 推荐(0) 编辑
摘要: #include #define LL long long using namespace std; const LL mod=1e9+7; const int maxn=1e6+10; #define lowbit(x) (x&(-x)) struct BIT { LL**a;int n,m; BIT(){a=0;n=m=-1;} BIT(int n,int m):n... 阅读全文
posted @ 2018-11-01 21:05 BIack_Cat 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #include #define LL long long using namespace std; const LL mod=1e9+7; const int maxn=5e5+10; int n;LL t; inline int read() { int x=0,f=1;char ch=getchar(); while(ch'9'){if(ch=='-')f=-1;ch=g... 阅读全文
posted @ 2018-11-01 21:02 BIack_Cat 阅读(176) 评论(0) 推荐(0) 编辑
摘要: #include //卡精度卡的蛋疼妈蛋 using namespace std; #define LL long long const int maxn=1e4+10; const int blk=256; vectormp[blk*blk]; #define eps 1e-8 #define inside(x,y) (x>=0&&x=0&&y=1;f--) { p.... 阅读全文
posted @ 2018-10-18 00:24 BIack_Cat 阅读(166) 评论(0) 推荐(0) 编辑
摘要: //写完和贴吧群dalao的代码比了一下 结果发现总是有更好的写法让你规避bug - -郁闷https://paste.ubuntu.com/p/8RRBw7jrHQ/#include using namespace std; #define LL long long const int maxn=2e2+10; char r[15]="123456789AJKQ"; char l[15]="... 阅读全文
posted @ 2018-10-17 04:14 BIack_Cat 阅读(207) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/DevilInChina/p/9691126.html 这个dalao 的思路 设平移球心到原点后 当前飞船坐标为 p(y_1,y_2,..,y_k) 球面上该点坐标q(a_1,a_2,...,a_k) 设 F(p) = sigma(yi-ai)^2 + 阅读全文
posted @ 2018-10-16 00:30 BIack_Cat 阅读(208) 评论(0) 推荐(0) 编辑
摘要: #include //题目要求01矩阵的//第一行除了A11只能有1个1//最后一列除了Ann只能有1个1//除了矩阵的四条边,里面的点要求该点所在行列1的个数各自相等//最后可以发现 如果说题目给了一个完全图的边权矩阵,那么01矩阵就显示了在这个图上的的一条路径//巧妙的修改spfa求最小环就oK using namespace std; #define LL long long const ... 阅读全文
posted @ 2018-10-15 17:52 BIack_Cat 阅读(93) 评论(0) 推荐(0) 编辑
摘要: #include #define LL long long using namespace std; const int maxn=1e5+10; struct nod { int x,k;int i; bool operator mp; LL f(LL y) { LL r=0; while(y) { r+=a[y%10][k]; ... 阅读全文
posted @ 2018-10-15 17:46 BIack_Cat 阅读(171) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; #define LL long long const int maxn=1e6+10; const LL mod=1e9+7; int phi[maxn], p[maxn+1]; bool check[maxn]; int phi_and_prime_table() { phi[1]=1; int sz=0; ... 阅读全文
posted @ 2018-10-13 16:10 BIack_Cat 阅读(135) 评论(0) 推荐(0) 编辑