摘要:
题意: 给一个n*m的方格,里面放着横竖的单词,问从里面最多可以选出多少组单词并使他们互不冲突。分析: 二分图最大独立权集,求出最大匹配数,总结点数减去最大匹配即为答案。View Code #include<stdio.h>#include<string.h>#define clr(x)memset(x,0,sizeof(x))char map[2002][2002];int a[2002][2002];int link[505];int v[505];struct node{ int to,next;}q[1000000];int head[2002];int tot 阅读全文
posted @ 2012-06-06 23:57
'wind
阅读(216)
评论(0)
推荐(0)
摘要:
题意: 给一串字符,有三种操作'<' '>' '-' 表示左移,右移,删除,要求输出最后结果。分析: 建立双向链表模拟之...第一个用双向链表做的题,wa了N次。。。--!View Code #include<stdio.h>#include<string.h>#include<stdlib.h>struct node{ node *next; node *pre; char c;};char s[1000005];node *a[1000005];int main(){ int n; int to 阅读全文
posted @ 2012-06-06 23:16
'wind
阅读(231)
评论(0)
推荐(0)


浙公网安备 33010602011771号