2013年11月27日

Codeforces 215A A.Sereja and Coat Rack

摘要: A. Sereja and Coat Racktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSereja owns a restaurant fornpeople. The restaurant hall has a coat rack withnhooks. Each restaurant visitor can use a hook to hang his clothes on it. Using thei-th hook costsa 阅读全文

posted @ 2013-11-27 01:12 天使是一个善良的神 阅读(313) 评论(0) 推荐(0) 编辑

Codeforces 215B B.Sereja and Suffixes

摘要: #include #include #include #include #include int sum;int n,m;int a[100010];int l[100010];int s[100010];int map[100010];int main(){ while(~scanf("%d%d",&n,&m)) { memset(a,0,sizeof(a)); memset(l,0,sizeof(l)); memset(s,0,sizeof(s));; for(int i = 1;i = 1;i --) { ... 阅读全文

posted @ 2013-11-27 01:11 天使是一个善良的神 阅读(329) 评论(0) 推荐(0) 编辑

2013年11月19日

HDU 4788 Hard Disk Drive

摘要: Hard Disk DriveTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 125Accepted Submission(s): 75 Problem Description Yesterday your dear cousin Coach Pang gave you a new 100MB hard disk drive (HDD) as a gift because you will get married next year. ... 阅读全文

posted @ 2013-11-19 23:58 天使是一个善良的神 阅读(335) 评论(0) 推荐(0) 编辑

HDU 2095 find your present (2)

摘要: find your present (2)Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/1024 K (Java/Others) Total Submission(s): 13413Accepted Submission(s): 5049 Problem DescriptionIn the new year party, everybody will get a "special present".Now it's your turn to get your special present, a 阅读全文

posted @ 2013-11-19 13:37 天使是一个善良的神 阅读(206) 评论(0) 推荐(0) 编辑

2013年11月18日

图的连通性问题—学习笔记

摘要: 连通性问题主要有求有向图的强连通分量的三种算法,Kosaraju,Trajan,Carbow:最小点基和最小权点基础:无向图的双连通分量以及求桥和割点的Trarjan算法:全局最小权割问题和Stoer—Wagner算法:2—SAT本来图论的学习在十一月份的时候我应该结束第一轮的,但是由于该死的考试,第一轮只能进行到无向图的双连通了,图论还剩下网络流和二分图及匹配算法,两个大的专题,没有办法只能在来年一,二月份进行了,本来那段时间是用来图论进阶的和学习计算几何的,哎,坑爹的考试,可不能挂科啊,啊Ksaraju:Ksaraju算法基于强连通分量内部所有的点都可以互达的,那么对原图G和反图GT分别进 阅读全文

posted @ 2013-11-18 21:55 天使是一个善良的神 阅读(272) 评论(0) 推荐(0) 编辑

无向图的双连通

摘要: 点连通度与边连通度在一个无向连通图中,如果有一个顶点集合,删除这个顶点集合,以及这个集合中所有顶点相关联的边以后,原图变成多个连通块,就称这个点集为割点集合。一个图的点连通度的定义为,最小割点集合中的顶点数。类似的,如果有一个边集合,删除这个边集合以后,原图变成多个连通块,就称这个点集为割边集合。一个图的边连通度的定义为,最小割边集合中的边数。[双连通图、割点与桥]如果一个无向连通图的点连通度大于1,则称该图是点双连通的(pointbiconnected),简称双连通或重连通。一个图有割点,当且仅当这个图的点连通度为1,则割点集合的唯一元素被称为割点(cutpoint),又叫关节点(artic 阅读全文

posted @ 2013-11-18 13:33 天使是一个善良的神 阅读(561) 评论(0) 推荐(1) 编辑

2013年11月16日

UASCO Count the rectangles

摘要: Count the rectanglesTimeLimit:2 Second MemoryLimit:64 MegabyteTotalsubmit:64 Accepted:36 DescriptionYou are given numbers of rectangles made of '1's and '0's.Calculate how many small rectangles which have four '1's on the four corners.InputThere are several test cases, each t 阅读全文

posted @ 2013-11-16 14:05 天使是一个善良的神 阅读(256) 评论(0) 推荐(0) 编辑

UASCO Photo

摘要: PhotoTimeLimit:2 Second MemoryLimit:64 MegabyteTotalsubmit:33 Accepted:13 DescriptionFJ wants to take pictures of his N cows (2 #include #include #include #include using namespace std;int can_be[1010][1010];int map[10010];int the_last_sum;int n,k;int a,b;struct Node{ int x; int posi;}v[10010];in... 阅读全文

posted @ 2013-11-16 14:03 天使是一个善良的神 阅读(309) 评论(0) 推荐(0) 编辑

USACO Breed Proximity

摘要: Breed ProximityTimeLimit:2 Second MemoryLimit:64 MegabyteTotalsubmit:46 Accepted:10 DescriptionFarmer John's N cows (1 #include #include #include #include using namespace std;int map[51010];int can_be[1100000];int the_last_max;int n,k;int main(){ while(~scanf("%d%d",&n,&k)) { m 阅读全文

posted @ 2013-11-16 14:02 天使是一个善良的神 阅读(560) 评论(0) 推荐(0) 编辑

2013年11月15日

HDU 3560 Graph’s Cycle Component

摘要: Graph’s Cycle ComponentTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 1655Accepted Submission(s): 637 Problem DescriptionIn graph theory, a cycle graph is an undirected graph that consists of a single cycle, or in other words, some number of ver 阅读全文

posted @ 2013-11-15 19:22 天使是一个善良的神 阅读(305) 评论(0) 推荐(0) 编辑

导航