自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

nudt_oys的博客

欢迎访问个人网站:https://www.cnblogs.com/littleorange/

  • 博客(288)
  • 收藏
  • 关注

原创 POJ 1013 Counterfeit Dollar(枚举)

Counterfeit DollarDescriptionSally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is counterfeit even though its color and s

2017-02-24 22:54:39 516

原创 CSUOJ 1219 建食堂(两点之间最大距离最小)

1219: 建食堂给出n个公寓的互相距离,选择在其中一个公寓楼下建食堂,要求食堂到最远的公寓的距离最短。Input每组数据第一行为两个正整数n,m。n表示公寓数,m表示可彼此直达的公寓对。接下来m行每行给出两个彼此可直达的公寓i、j和它们之间的距离k。2 Output输出一行一个整数表示建好

2016-12-25 18:49:58 583

原创 指针和数组

在C语言中,指针与数组之间的关系十分密切,任何通过数组下标能完成的操作都可以用指针来实现。一般来说,用指针实现的操作会比用数组下标完成的操作快一些;但另一方面,用指针实现的程序理解起来稍微困难一些。声明int a[10];定义了一个长度为10的数组,换句话说,它在内存中开辟了一块连续的空间用来存放10个元素:a[0],a[1],…,a[9]。其中a[i]表示数组中的第i个元素。如果pa

2016-12-24 18:48:29 384

原创 HDOJ 1215 统计难题(字典树)

统计难题Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单

2016-12-04 20:15:28 480

原创 UVaOJ 11877 The Coco-Cola Store(简单数学题)

Once upon a time, there is a special coco-cola store. If you return three empty bottles to the shop,you’ll get a full bottle of coco-cola to drink. If you have n empty bottles right in your hand, how

2016-11-23 19:11:21 886

原创 HDOJ 1018 Big Number(Stirling公式)

Big NumberProblem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In

2016-11-21 16:48:19 356

原创 CSUOJ 1010 Water Drinking(BFS)

1010: Water DrinkingDescriptionThe Happy Desert is full of sands. There is only a kind of animal called camel living on the Happy Desert. ‘Cause they live here, they need water here. Fortuna

2016-11-20 10:34:16 510

原创 HDOJ 3549 Flow Problem(最大流)

Flow ProblemDescriptionNetwork flow is a well-known difficult problem for ACMers. Given a graph, your task is to find out the maximum flow for the weighted directed graph.I

2016-11-12 12:39:25 393

原创 POJ 1273 Drainage Ditches(最大流)

Drainage DitchesDescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and take

2016-11-11 23:16:44 364

原创 HDOJ 2377 Bus Pass(建图 + BFS)

Bus PassProblem DescriptionYou travel a lot by bus and the costs of all the seperate tickets are starting to add up. Therefore you want to see if it might be advantageous for you to bu

2016-10-27 23:12:54 346

原创 POJ 2240 Arbitrage(最短路)

ArbitrageDescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose

2016-10-23 23:03:03 292

原创 POJ 3660 Cow Contest(Floyd求传递闭包)

Cow ContestDescriptionN (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certai

2016-10-21 19:35:53 354

原创 HDOJ 1162 Eddy's picture(最小生成树)

Eddy's pictureProblem DescriptionEddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his small room, and he usually

2016-10-17 22:36:29 457

原创 HDOJ 1728 逃离迷宫(BFS + 记录拐弯次数)

逃离迷宫Problem Description  给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方

2016-10-11 17:04:53 610

原创 UVaOJ 10305 Ordering Tasks(拓扑排序)

Ordering TasksJohn has n tasks to do. Unfortunately, the tasks are not independent and the execution of one task isonly possible if other tasks have already been executed.InputThe input will con

2016-09-11 09:06:19 401

原创 UVaOJ 10048 Audiophobia(最小化最短路的最大权值边)

AudiophobiaConsider yourself lucky! Consider yourself lucky to be still breathing and having fun participating inthis contest. But we apprehend that many of your descendants may not have this luxury

2016-09-06 15:41:12 725

原创 Dijkstra算法(单源最短路径)

Dijkstra算法        Dijkstra算法解决的是带权重的有向图上单源最短路径问题,所谓单源最短路径,就是固定一个顶点为源点,求源点到其他每个顶点的最短路径,该算法要求图上所有边的权值为非负值。        Dijkstra算法在运行过程中,将整个图划分为两个点集合S与T,其中源点s到点集合S中所有顶点的最短路径已经被找到,而s到T中所有顶点的最短路径还没有被找到。初始时,

2016-09-06 09:08:42 1171

原创 UVaOJ 247 Calling Circles(传递闭包)

Calling CirclesIf you’ve seen television commercials for long-distance phone companies lately, you’ve noticed thatmany companies have been spending a lot of money trying to convince people that they

2016-09-05 22:36:54 404

原创 CSUOJ 1808 地铁(最短路)

1808: 地铁DescriptionBobo居住在大城市ICPCCamp。ICPCCamp 有 n 个地铁站,用 1,2,…,n 编号。 m 段双向的地铁线路连接 n 个地铁站,其中第 i 段地铁属于 ci 号线,位于站 ai,bi 之间,往返均需要花费 ti 分钟(即从 ai 到 bi 需要 ti 分钟,从 bi 到 ai 也需要 ti 分钟)。众所

2016-09-04 15:25:32 1486

原创 POJ 2784 Buy or Build(二进制枚举 + 最小生成树)

Buy or BuildDescriptionWorld Wide Networks (WWN) is a leading company that operates large telecommunication networks. WWN would like to setup a new network in Borduria, a nice country that

2016-09-03 21:55:04 512

原创 POJ 2139 Six Degrees of Cowvin Bacon(最短路)

Six Degrees of Cowvin BaconDescriptionThe cows have been making movies lately, so they are ready to play a variant of the famous game "Six Degrees of Kevin Bacon". The game works like

2016-09-02 21:42:49 383

原创 AOJ 2224 Save your cats(最小生成树)

Save your catsNicholas Y. Alford was a cat lover. He had a garden in a village and kept many cats in his garden. The cats were so cute that people in the village also loved them.One day, an

2016-09-02 15:04:33 546

原创 AOJ 0189 Convenient Location(最短路)

Convenient Location来春卒業するAさんは,就職を機に引越しをすることにしました。就職する会社は,オフィスがい くつかの町にあって、日によって出勤するオフィスが違います。そこでAさんは,どこのオフィスに 行くにも時間の短い町に住もうと考えました。そこであなたは、Aさんを助けるため、住むのに一番便利な町を探すことになりました。町には0から始まる番号

2016-09-02 08:49:21 369

原创 AOJ 2249 Road Construction(双权值最短路)

Road ConstructionKing Mercer is the king of ACM kingdom. There are one capital and some cities in his kingdom. Amazingly, there are no roads in the kingdom now. Recently, he planned to construct

2016-09-02 08:06:43 814

原创 HDOJ 5253 连接的管道(最小生成树)

连接的管道Problem Description老 Jack 有一片农田,以往几年都是靠天吃饭的。但是今年老天格外的不开眼,大旱。所以老 Jack 决定用管道将他的所有相邻的农田全部都串联起来,这样他就可以从远处引水过来进行灌溉了。当老 Jack 买完所有铺设在每块农田内部的管道的时候,老 Jack 遇到了新的难题,因为每一块农田的地势高度都不同,所以要想将两块农田的管

2016-08-30 22:04:18 366

原创 HDOJ 3790 最短路径问题(双权值最短路)

最短路径问题Problem Description给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。 Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度为d,花费为p。最后一行是两个数

2016-08-27 10:09:29 725

原创 POJ 1511 Invitation Cards(双向最短路)

Invitation CardsDescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater an

2016-08-27 09:54:56 568

原创 POJ 3522 Slim Span(最小差值生成树)

Slim SpanDescriptionGiven an undirected weighted graph G, you should find one of spanning trees specified as follows.The graph G is an ordered pair (V, E), where V is a set of vertices {

2016-08-26 21:14:26 1717

原创 POJ 3268 Silver Cow Party(双向最短路)

Silver Cow PartyDescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤

2016-08-26 13:49:18 529

原创 POJ 3273 Conscription(最小生成树)

ConscriptionDescriptionWindy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and wants to collect them to be his soldiers. To colle

2016-08-25 21:56:49 369

原创 HDOJ 1102 Constructing Roads(最小生成树)

Constructing RoadsProblem DescriptionThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say

2016-08-24 18:04:35 317

原创 HDOJ 1856 More is better(并查集)

More is betterProblem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be. Of course there are

2016-08-24 16:32:27 350

原创 POJ 1258 Agri-Net(最小生成树)

Agri-NetDescriptionFarmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course. 

2016-08-23 22:45:17 340

原创 POJ 3259 Wormholes(判负圈)

WormholesDescriptionWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to

2016-08-22 16:57:40 282

原创 HDOJ 3635 Dragon Balls(并查集)

Dragon BallsProblem DescriptionFive hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) to gather all of the dragon ba

2016-08-21 17:17:32 329

原创 CodeForces 707B Bakery(建图 + 枚举)

B. BakeryMasha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities.

2016-08-21 09:12:23 508

原创 HDOJ 2066 一个人的旅行(最短路)

一个人的旅行Problem Description虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜

2016-08-20 20:15:34 305

原创 POJ 3255 Roadblocks(次短路)

RoadblocksDescriptionBessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she lik

2016-08-20 16:00:10 274

转载 POJ 2142 The Balance(扩展欧几里德)

The BalanceDescriptionMs. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dose of medicine. For example, to measure 200mg of aspirin using 300mg weights and 70

2016-08-19 23:35:53 648

原创 POJ 2115 C Looooops(扩展欧几里德 + 求解模线性方程)

C LooooopsDescriptionA Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; variable += C) statement;I.e., a loop which starts by s

2016-08-19 21:53:42 396

空空如也

空空如也

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

TA关注的人

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