自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Prim

我不是Prim

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

原创 郑大校赛-NYOJ-198-数数(水题)

数数 时间限制:3000 ms | 内存限制:65535 KB 难度:2 描述 我们平时数数都是喜欢从左向右数的,但是我们的小白同学最近听说德国人数数和我们有些不同,他们正好和我们相反,是从右向左数的。因此当他看到123时会说“321”。现在有一位德国来的教授在郑州大学进行关于ACM的讲座。现在他聘请你来担任他的助理,他给你一些资料让你找到这些资料在书中的页数。现在你已经找到了对应的页码

2016-05-30 19:26:58 547

原创 NYOJ-127-星际之门(一)(N阶完全图所有生成树数量num=N*(N-2))

星际之门(一) 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 公元3000年,子虚帝国统领着N个星系,原先它们是靠近光束飞船来进行旅行的,近来,X博士发明了星际之门,它利用虫洞技术,一条虫洞可以连通任意的两个星系,使人们不必再待待便可立刻到达目的地。帝国皇帝认为这种发明很给力,决定用星际之门把自己统治的各个星系连结在一起。可以证明,修建N-1条虫洞就可以把这N

2016-05-30 19:06:09 1370

原创 NYOJ-38-布线问题(普利姆)

布线问题 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 南阳理工学院要进行用电线路改造,现在校长要求设计师设计出一种布线方式,该布线方式需要满足以下条件: 1、把所有的楼都供上电。 2、所用电线花费最少 输入 第一行是一个整数n表示有n组测试数据。(n<5) 每组测试数据的第一行是两个整数v,e. v表示学校里楼的总个数(v<=500) 随后的e

2016-05-30 15:29:36 527

原创 POJ-1751-Highways(普利姆 打印最小生成树的边)

H - Highways Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1751 Description The island nation of Flatopia is perfectly flat. Unfortunately, Fl

2016-05-30 13:40:31 2004

原创 CodeForces-505B-Mr. Kitayuta's Colorful Graph(弗洛伊德)

H - Mr. Kitayuta’s Colorful Graph Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeCodeForces 505B Description Mr. Kitayuta has just bought an undir

2016-05-28 19:37:44 717

原创 CodeForces-55B-Smallest number(暴力深搜)

B - Smallest number Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeCodeForces 55B Description Recently, Vladimir got bad mark in algebra again. To

2016-05-27 15:31:28 3486

原创 POJ-1308-Is It A Tree?(并查集)

E - Is It A Tree? Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1308 Description A tree is a well-known data structure that is either empty (n

2016-05-27 13:45:02 602 1

原创 POJ-3468-A Simple Problem with Integers(线段树区间维护 重写Lazy)

D - A Simple Problem with Integers Time Limit:5000MS Memory Limit:131072KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 3468 Description 给出了一个序列,你需要处理如下两种询问。“C a b c”表示给[a, b]区间中的值

2016-05-26 16:48:07 342

原创 POJ-2236-Wireless Network(并查集)

A - Wireless Network Time Limit:10000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 2236 Description An earthquake takes place in Southeast Asia. The ACM (Asi

2016-05-26 11:19:00 314

原创 HDU-1317-XYZZY(负权处理 弗洛伊德判断连通性)

D - 最短路(负权处理) Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1317 Description It has recently been discovered how to run open-source software o

2016-05-25 13:00:18 646

原创 HDU-1874-畅通工程续(随便你什么算法,反正我是睡不着)

D - 畅通工程续 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1874 Description 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某

2016-05-25 01:22:33 523

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

I - Agri-Net Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1258 Description Farmer John has been elected mayor of his town! One of his campaig

2016-05-22 15:10:52 372

原创 ZOJ-1586-QS Network(最小生成树 普利姆)

E - QS Network Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatusPracticeZOJ 1586 Description Sunny Cup 2003 - Preliminary RoundApril 20th, 12:00 - 17:00Problem

2016-05-22 14:52:43 469 1

原创 POJ-2421-Constructing Roads(最小生成树 普利姆)

D - Constructing Roads Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 2421 Description There are N villages, which are numbered from 1 to N, an

2016-05-21 19:43:15 1266 2

原创 fixed<<setprecision(n)

cout<<fixed<<setprecision(n)<<num<<endl;控制浮点数num小数点后输出n位数。某些变态的题会要求用这种方法输出浮点数!!

2016-05-21 19:10:13 395

原创 POJ-2031-Building a Space Station-(最小生成树 普利姆)

C - Building a Space Station Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 2031 Description You are a member of the space station engineering

2016-05-21 17:30:40 301

原创 POJ-1287-Networking(最小生成树 普利姆)

B - Networking Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1287 Description You are assigned to design network connections between certain p

2016-05-21 15:55:52 408

原创 POJ-1251-Jungle Roads(最小生成树 克鲁斯卡尔)

A - Jungle Roads Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1251 Description The Head Elder of the tropical island of Lagrishan has a probl

2016-05-21 15:20:53 741

原创 HDU-1875-畅通工程再续(最小生成树 普利姆)

N - 畅通工程再续 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1875 Description 相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百

2016-05-19 15:01:46 372

原创 HDU-1233-还是畅通工程(最小生成树 克鲁斯卡尔)

L - 还是畅通工程 Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1233 Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定

2016-05-19 12:51:30 449

原创 POJ-1308-Is It A Tree?(并查集 判断树)

F - Is It A Tree? Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1308 Description A tree is a well-known data structure that is either empty (n

2016-05-19 12:29:26 667

原创 POJ-2524-Ubiquitous Religions(并查集 集合数量)

E - Ubiquitous Religions Time Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 2524 Description 当今世界有很多不同的宗教,很难通晓他们。你有兴趣找出在你的大学里有多少种不同的宗教信仰。 你知道在你的大学

2016-05-19 11:39:06 325

原创 HDU-1856-More is better(并查集 集合最值)

C - More is better Time Limit:1000MS Memory Limit:102400KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1856 Description Mr Wang wants some boys to help him with a project. Because

2016-05-18 23:04:41 376

原创 HDU-1213-How Many Tables(并查集)

A - How Many Tables Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1213 Description Today is Ignatius’ birthday. He invites a lot of friends. N

2016-05-18 20:36:54 372

原创 HDU-1233-畅通工程(并查集)

B - 畅通工程 Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1232 Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通

2016-05-18 20:05:56 530 2

原创 HDU-1394-Minimum Inversion Number(最小逆序数-模拟)

B - Minimum Inversion Number Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1394 Description The inversion number of a given number sequence a1

2016-05-17 13:58:52 361

原创 HDU-1698-Just a Hook(再写Lazy)

B - Just a Hook Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for

2016-05-16 14:18:58 300

原创 HDU-1754-I Hate It(线段树求区间最值)

C - I Hate It Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求

2016-05-16 13:37:10 335

原创 HDU-1166- 敌兵布阵(线段树 插点问线)

A - 敌兵布阵 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视

2016-05-16 11:22:12 674

转载 华中农业大学第四届程序设计大赛网络同步赛Problem I: Catching Dogs

Problem I: Catching Dogs Time Limit: 1 Sec Memory Limit: 128 MB Submit: 1135 Solved: 294 [Submit][Status][Web Board] DescriptionDiao Yang keeps many dogs. But today his dogs all run away. Diao Ya

2016-05-15 17:18:13 1196 4

原创 华中农业大学第四届程序设计大赛网络同步赛Problem J: Arithmetic Sequence

Problem J: Arithmetic Sequence Time Limit: 1 Sec Memory Limit: 128 MB Submit: 1801 Solved: 306 [Submit][Status][Web Board] Description Giving a number sequence A with length n, you should ch

2016-05-15 17:10:56 591

原创 BNUOJ-33687-Beautiful Spacing(二分+DP)

看原文点这里题意:多组数据,每组数据第一行给出W,N。W代表网格一行有W个位置,N代表有N个单词,第二行给出N个数,代表单词的长度。模仿正常单词的书写,在单词顺序不变的前提下,两个单词之间可以间隔任意个空格,只要不超过网格限制。输出最小空格中的最大空格。(具体规则看题很容易读懂)思路:二分+DP,DP[i]记录第i个单词是否可以作为一行的结尾,接着就是不停的判断二分中点是否满足最小空格中的最大空格这

2016-05-14 18:17:19 569

原创 HDU-4027-Can you answer these queries?(线段树)

Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 11957 Accepted Submission(s): 2833Problem Description A lot of

2016-05-13 20:10:03 420

原创 ZOJ-1610- Count the Colors(端点染色,Lazy算法)

F - Count the Colors Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatusPracticeZOJ 1610 Description Painting some colored segments on a line, some previously pa

2016-05-13 11:03:04 512

原创 POJ-3264-Balanced Lineup(裸线段树)

G - Balanced Lineup Time Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 3264 Description For the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50,000

2016-05-12 20:24:27 599

原创 HDU-1698-Just a Hook(Lazy算法)

E - Just a Hook Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1698 Description In the game of DotA, Pudge’s meat hook is actually the most hor

2016-05-12 14:20:24 565

原创 POJ-3468-A Simple Problem with Integers(Lazy算法)

C - A Simple Problem with Integers Time Limit:5000MS Memory Limit:131072KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 3468 Description You have N integers, A1, A2, … , AN. You ne

2016-05-12 11:48:54 726

原创 BNUOJ-20950-沉重的货物(最小生成树的Prim算法)

E. 沉重的货物 Time Limit: 1000msMemory Limit: 65536KB 64-bit integer IO format: %lld Java class name: Main Submit Status PID: 20950CUITCPC是一个专门生产大型货运火车的工厂。他们的新型货运火车XX V1.0,是如此之大,以至于可以运输的货物的重量并不取决于那个火

2016-05-11 12:44:26 500

原创 第三届河南省程序设计大赛-NYOJ-250-ROOM ASSIGNATION

ROOM ASSIGNATION 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 The “cows” are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superi

2016-05-07 22:15:08 1409

原创 POJ-1847-Tram(裸迪杰斯特拉或弗洛伊德)

R - 基础最短路 Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1847 Description Tram network in Zagreb consists of a number of intersections and rail

2016-05-07 10:44:56 735

《数据结构》算法实现及解析[第二版]高一凡

数据结构课本的电子版

2016-03-19

空空如也

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

TA关注的人

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