摘要: Bus SystemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5709 Accepted Submission(s): 1449 Problem DescriptionBecause of the huge population of China, public transportation is very important. Bus is an important transportation method in traditio 阅读全文
posted @ 2013-12-17 17:20 陈泽泽 阅读(211) 评论(0) 推荐(0) 编辑
摘要: Eddy's pictureTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5797 Accepted Submission(s): 2913 Problem DescriptionEddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his 阅读全文
posted @ 2013-12-17 15:55 陈泽泽 阅读(500) 评论(0) 推荐(0) 编辑
摘要: Constructing RoadsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 11894 Accepted Submission(s): 4496 Problem DescriptionThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect 阅读全文
posted @ 2013-12-17 15:30 陈泽泽 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Problem 1205 小鼠迷宫问题 问题描述 小鼠a与小鼠b身处一个m×n的迷宫中,如图所示。每一个方格表示迷宫中的一个房间。这m×n个房间中有一些房间是封闭的,不允许任何人进入。在迷宫中任何位置均可沿上,下,左,右4个方向进入未封闭的房间。小鼠a位于迷宫的(p,q)方格中,它必须找出一条通向小 阅读全文
posted @ 2013-12-15 11:04 陈泽泽 阅读(283) 评论(0) 推荐(0) 编辑
摘要: Red and BlackTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7337 Accepted Submission(s): 4591 Problem DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. 阅读全文
posted @ 2013-12-14 23:49 陈泽泽 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 问题描述:赤壁之战前夕,庞统向周瑜献连环计,瑜设计使蒋干邀庞统到曹营。操与统同观营寨,又共论兵法。统对答如流使操敬服。统乘机提出:大江中风浪不息使北兵易生疾病。可将大小船配搭,首尾用铁环连锁,铺阔板以便人马行走。操闻之大喜,派人连夜打造连环大钉,锁住船只。每打造一单位长度的铁索要花费一单位的钱,曹操希望用最少的花费将n 艘战船连接起来(任意两艘战船直接或间接被铁索连接),每艘战船可以看成一个点,坐标为(xi,yi),曹营中有一位神秘人物,他所在的战船必须和曹操所在战船直接连接,求最小花费。数据输入:第一行战船数n(2 3 #include 4 #include 5 double g[101][ 阅读全文
posted @ 2013-12-07 01:13 陈泽泽 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 int dis[601][601]; 3 int path[601][601]; 4 void floyd(int n) 5 { 6 for(int k=1;k=0;i--) 38 { 39 if(i!=0) 40 printf("%d -> ",p[i]); 41 else 42 ... 阅读全文
posted @ 2013-12-06 22:47 陈泽泽 阅读(691) 评论(0) 推荐(0) 编辑
摘要: 小希的迷宫Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21562 Accepted Submission(s): 6591 Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A 阅读全文
posted @ 2013-12-04 21:55 陈泽泽 阅读(341) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, and all the friends do not want to stay with strangers.One important rule 阅读全文
posted @ 2013-12-04 10:38 陈泽泽 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 typedef struct ufset *UFset; 6 struct ufset 7 { 8 int parent[100001]; 9 int root[100001];10 }UFS;11 int s[100001],y[100001],d[10000],add;12 int UFfind(int e,UFset U)13 {14 int i,j=e;15 while(U->root[j]==0)16 {17 j... 阅读全文
posted @ 2013-12-02 00:50 陈泽泽 阅读(831) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 typedef struct ufset *UFset; 4 struct ufset 5 { 6 int parent[100001]; 7 int root[100001]; 8 }UFS; 9 int UFfind(int e,UFset U)10 {11 int i,j=e;12 while(U->root[j]==0)13 {14 //printf("parent[%d]=%d root=%d\n",j,U->parent[j],U->root[j]);15 j=... 阅读全文
posted @ 2013-12-02 00:18 陈泽泽 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 typedef struct node *btlink; 4 struct node 5 { 6 int data; 7 btlink left; 8 btlink right; 9 int t; 10 }; 11 12 btlink BT; 13 void insert(btlink q, i... 阅读全文
posted @ 2013-11-30 17:26 陈泽泽 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 开始一个数 开始一个数 开始一个数 n,(1 3 #include 4 #include 5 typedef struct node *btlink; 6 struct node 7 { 8 int data; 9 btlink left;10 btlink right;11 };12 btlink BT,NewBT;13 char s1[11],s2[11];14 btlink insert(btlink root,int x)15 {16 btlink q;17 q=(btlink)malloc(sizeof(node));18 q->lef... 阅读全文
posted @ 2013-11-25 19:42 陈泽泽 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 算法实际上是模仿快速排序算法设计出来的,其基本思想也是对输入数组进行递归划分,与快速排序不同的是,它只对划分出来的子数组之一进行递归处理;int randompartition(int a[],int l,int r){ int i=l-1,j=r,v=a[r],tmp; for(;;) { while(a[++i]v)if(j==l)break; if(i>=j)break; tmp=a[i]; a[i]=a[j]; a[j]=tmp; } tmp=a[i];a[i]=a[r];a[r]=tm... 阅读全文
posted @ 2013-11-19 19:35 陈泽泽 阅读(485) 评论(0) 推荐(0) 编辑
摘要: 题意关键句:搜集足够的材料确保两种制作方式都能满足.31 3 133 3 1编号1至少收集2个,编号3至少收集2个,才能同时满足两种方法。因为不知道编号到底有多大,用位向量表示集合的无法判断需要开多少位。而有序链表恰恰弥补这个缺点。 1 #include 2 #include 3 typedef struct node *link; 4 struct node 5 { 6 int data;//数据域 7 link next; 8 }Node; 9 typedef struct list *Set; 10 struct list 11 { 12 li... 阅读全文
posted @ 2013-11-08 00:53 陈泽泽 阅读(312) 评论(0) 推荐(0) 编辑