摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1251将每次走过得字母统计数量 查找的时候输出字母数量的最小值View Code 1 #include<stdio.h> 2 #include<iostream.h> 3 #include<string.h> 4 struct node 5 { 6 int count; 7 node *next[27]; 8 node() 9 {10 count = 0;11 memset(next,NULL,sizeof(next));12 }13 ... 阅读全文
posted @ 2012-07-24 20:59 _雨 阅读(189) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=10941A 这题下午想了好久 一直没调出来 由于是边输入边拓扑排序 入度改变之后下次再排会出错 晚上回来想到这一点 每次全复制一遍 只对入度进行操作 不进行改变这个题要 判断三种情况一种是有环在给出几种关系时出现矛盾二是在给出几种关系时 n个数已经排好了序三是输完还是无法排出一种序 这是属于拓扑排序不唯一的情况 也就是同时有多个结点出现的入度为0View Code 1 #include 2 #include 3 int f[100],g[50][50],kk[30],q[50]; 4 int topo(int n,int m) ... 阅读全文
posted @ 2012-07-24 19:19 _雨 阅读(312) 评论(4) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2094其实这题也不算是拓扑排序了 只需要判断最开始入度是否唯一就可以了 如果是0 肯定有环了 不是0 会有多个冠军也不对View Code 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int de[1001]; 7 int main() 8 { 9 int i,j,k,g,n,fg;10 string s1,s2;11 while(cin>>n)12 {13 if(!... 阅读全文
posted @ 2012-07-24 16:59 _雨 阅读(196) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2632好繁琐的一道模拟题 对着测试数据改了将近三个小时才过View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 int i,j,t,n,m,a,b,c[101],f[101][101],x[101],y[101],xi,yi,cs1,cs2,crash; 6 char ci,c1; 7 scanf("%d",&t); 8 while(t--) 9 { 10 scanf("%d%d".. 阅读全文
posted @ 2012-07-24 15:31 _雨 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 第一次做 移动不给力啊 WLAN连了不下10次 第一题写完再那无奈的等了20分钟 WLAN艰难的以非常低的信号给连了几分钟 交完又掉了D题不难 就是数据类型用错了A. Dubsteptime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Rece 阅读全文
posted @ 2012-07-24 01:42 _雨 阅读(333) 评论(2) 推荐(0) 编辑