自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Alex

开心了就笑,不开心就过会再笑

  • 博客(174)
  • 资源 (1)
  • 收藏
  • 关注

原创 POJ2945——Find the Clones

DescriptionDoubleville, a small town in Texas, was attacked by the aliens. They have abducted some of the residents and taken them to the a spaceship orbiting around earth. After some (quite unpleas

2014-08-31 22:24:17 550

原创 hdu1671 && POJ——Phone List

Problem DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:1. Emergenc

2014-08-31 20:18:17 618

原创 POJ2001——Shortest Prefixes

DescriptionA prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "carbo", and "carbon". Note that the empty strin

2014-08-31 16:38:32 470

原创 hdu1075——What Are You Talking About

Problem DescriptionIgnatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leave

2014-08-31 11:48:57 824

原创 hdu2852——KiKi's K-Number

Problem DescriptionFor the k-th number, we all should be very familiar with it. Of course,to kiki it is also simple. Now Kiki meets a very similar problem, kiki wants to design a container, the cont

2014-08-26 14:24:55 577

原创 hdu2838——Cow Sorting

Problem DescriptionSherlock's N (1 ≤ N ≤ 100,000) cows are lined up to be milked in the evening. Each cow has a unique "grumpiness" level in the range 1...100,000. Since grumpy cows are more likely

2014-08-25 21:23:09 447

原创 hdu3743——Frosh Week

Problem DescriptionDuring Frosh Week, students play various fun games to get to know each other and compete against other teams. In one such game, all the frosh on a team stand in a line, and are th

2014-08-25 20:29:05 876

原创 感想——树状数组和二维树状数组

一、树状数组  树状数组

2014-08-25 16:40:33 758

原创 POJ2155——Matrix

DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 We can change the matrix in the fol

2014-08-25 15:56:21 500

原创 POJ——Mobile phones

DescriptionSuppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares form an S * S matrix with the rows and

2014-08-25 14:12:16 616

原创 POJ3067——Japan

DescriptionJapan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <=

2014-08-24 20:12:50 632

原创 hdu1394——Minimum Inversion Number

Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj.For a given sequence of numbers a1, a2, ..., an, if we move

2014-08-24 19:45:37 586

原创 POJ2299——Ultra-QuickSort

DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the seque

2014-08-24 13:35:00 568

原创 POJ2481——Cows

DescriptionFarmer John's cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in his field is particularly good.Far

2014-08-23 20:27:51 558

原创 hdu4421 ZOJ 3656——Bit Magic

Problem DescriptionYesterday, my teacher taught me about bit operators: and (&), or (|), xor (^). I generated a number table a[N], and wrote a program to calculate the matrix table b[N][N] using thr

2014-08-23 18:16:44 674

原创 hdu——3622Bomb Game

Problem DescriptionRobbie is playing an interesting computer game. The game field is an unbounded 2-dimensional region. There are N rounds in the game. At each round, the computer will give Robbie t

2014-08-23 11:54:05 526

原创 POJ2749——Building roads

DescriptionFarmer John's farm has N barns, and there are some cows that live in each barn. The cows like to drop around, so John wants to build some roads to connect these barns. If he builds roads

2014-08-22 21:58:02 516

原创 POJ2723——Get Luffy Out

DescriptionRatish is a young man who always dreams of being a hero. One day his friend Luffy was caught by Pirate Arlong. Ratish set off at once to Arlong's island. When he got there, he found the s

2014-08-22 20:11:27 530

原创 POJ3648——Wedding

DescriptionUp to thirty couples will attend a wedding feast, at which they will be seated on either side of a long table. The bride and groom sit at one end, opposite each other, and the bride wea

2014-08-22 16:19:34 592

原创 POJ3678——Katu Puzzle

DescriptionKatu Puzzle is presented as a directed graph G(V, E) with each edgee(a, b) labeled by a boolean operator op (one of AND, OR, XOR) and an integerc (0 ≤ c ≤ 1). One Katu is solvable

2014-08-20 13:19:12 594

原创 POJ3683——Priest John's Busiest Day

DescriptionJohn is the only priest in his town. September 1st is the John's busiest day in a year because there is an old legend in the town that the couple who get married on that day will be f

2014-08-20 11:15:14 529

原创 POJ3207——Ikki's Story IV - Panda's Trick

Descriptionliympanda, one of Ikki’s friend, likes playing games with Ikki. Today after minesweeping with Ikki and winning so many times, he is tired of such easy games and wants to play another ga

2014-08-19 17:01:42 656

原创 NOJ1589——[1589] 老蔡和TT

问题描述老蔡和TT常常约会,他们的约会地点有n个,其中有一些约会地点是相通的,例如地点a到地点b之间有一条路,说明a可以到b,但b不能到a,有一天老菜在思考,怎样才能让这些地点都相互可达呢?因为TT前一刻喜欢在这里,下一刻就想到其他地方了,为了满足TT的愿望,老蔡向你求助,你能帮助他求出他最少要造的路吗?输入第一行包含2个整数,n,m (0接下来的m行,每行2个整数a和b,

2014-08-18 23:05:54 651

原创 hdu3342——Legal or Not

Problem DescriptionACM-DIY is a large QQ group where many excellent acmers get together. It is so harmonious that just like a big family. Every day,many "holy cows" like HH, hh, AC, ZT, lcc, BF, Qin

2014-08-18 20:43:43 497

原创 hdu4324——Triangle LOVE

Problem DescriptionRecently, scientists find that there is love between any of two people. For example, between A and B, if A don’t love B, then B must love A, vice versa. And there is no possibilit

2014-08-18 20:35:19 559

原创 hdu1285——确定比赛名次

Problem Description有N个比赛队(1 Input输入有若干组,每组中的第一行为二个数N(1 Output给出一个符合要求的排名。输出时队伍号之间有空格,最后一名后面没有空格。其他说明:符合条件的排名可能不是唯一的,此时要求输出时编号小的队伍在前;输入数据保证是正确的,即输入数据确保一定能有一个符合要求的排名。 S

2014-08-18 20:22:59 496

原创 hdu4547——CD操作 LCA在线算法

Problem Description  在Windows下我们可以通过cmd运行DOS的部分功能,其中CD是一条很有意思的命令,通过CD操作,我们可以改变当前目录。  这里我们简化一下问题,假设只有一个根目录,CD操作也只有两种方式:    1. CD 当前目录名\...\目标目录名 (中间可以包含若干目录,保证目标目录通过绝对路径可达)  2. CD .. (返回当前目录的

2014-08-18 17:03:49 819

原创 NOJ1437——[1437] Shutdown

问题描述某部队进行新兵队列训练,将新兵从一开始按顺序依次编号,并排成一行横队,训练的规则如下:从头开始一至二报数,凡报到二的出列,剩下的向小序号方向靠拢,再从头开始进行一至三报数,凡报到三的出列,剩下的向小序号方向靠拢,继续从头开始进行一至二报数。。。,以后从头开始轮流进行一至二报数、一至三报数直到剩下的人数不超过三人为止。输入本题有多个测试数据组,第一行为组数N,接着为N

2014-08-17 22:57:31 725

原创 无向图的割点,桥,双连通分量,有向图的强连通分量总结

一、无向图的割点,桥,双连通分量

2014-08-17 13:30:11 2334

原创 POJ 3177——Redundant Paths && POJ3352——Road Construction

3352:DescriptionIt's almost summer time, and that means that it's almost summer construction time! This year, the good people who are in charge of the roads on the tropical island paradi

2014-08-17 13:26:21 578

原创 HDU4738——Caocao's Bridges

Caocao's BridgesTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1417    Accepted Submission(s): 541Problem DescriptionCaocao was def

2014-08-16 21:36:07 527

原创 POJ1144——Network

DescriptionA Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N . No two places have the same number. The

2014-08-16 19:32:13 1012

原创 POJ2367——Genealogical tree

DescriptionThe system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they want. They gather together in different groups, so that a Martian can hav

2014-08-16 11:58:36 499

原创 POJ2186——Popular Cows

DescriptionEvery cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordered pairs of the form (A, B) that tel

2014-08-15 09:04:55 463

转载 图的割点、桥与双连通分支

原文地址:点击打开链接[点连通度与边连通度]在一个无向连通图中,如果有一个顶点集合,删除这个顶点集合,以及这个集合中所有顶点相关联的边以后,原图变成多个连通块,就称这个点集为割点集合。一个图的点连通度的定义为,最小割点集合中的顶点数。类似的,如果有一个边集合,删除这个边集合以后,原图变成多个连通块,就称这个点集为割边集合。一个图的边连通度的定义为,最小割边集合中的边数。

2014-08-15 08:30:18 530

原创 NOJ[1508] 火烧赤壁2

时间限制: 1000 ms 内存限制: 65535 K 问题描述上次出了一道火烧赤壁的题目给当时的新生,也就是你们的上一届学长们做,那么这次,我又想到了另一个想法。上次的火烧赤壁的题号为1274这次稍微难一点,我们来个火烧赤壁2吧。Hungar个人很喜欢曹操这个人,所以这次有机会穿越到三国时代,他想帮助曹操打赢赤壁之战。但是他去晚了,当他穿越到那的时候发现大火已经在蔓延了,

2014-08-14 21:41:33 1215

原创 POJ 1986——Distance Queries

DescriptionFarmer John's cows refused to run in his marathon since he chose a path much too long for their leisurely lifestyle. He therefore wants to find a path of a more reasonable length. The inp

2014-08-14 19:58:10 509

原创 LCA(最近公共祖先)tarjan算法学习笔记

给一棵树,问两个节点的最近公共祖先是什么。

2014-08-14 15:43:47 648

原创 POJ1236——Network of Schools

DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (the

2014-08-13 16:34:41 533

原创 hdu4635——Strongly connected

Problem DescriptionGive a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can add that the graph is still a simple directed graph. Also, after you

2014-08-13 15:55:25 532

线段树总结

大牛总结的线段树,很经典很有用,推荐学习

2014-09-30

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除