自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 最小生成树模板 POJ——1258

最小生成树是一个比较简单数据结构,形成最小生成树的方式有两种。 最小生成树是有图生成树,保证树的每条边的权值之和最小的生成树就叫做最小生成树,这一类的题目起初比较基础,主要是熟悉模板,POJ 1258 也就是这样的题目,非常适合刚刚学习的人。 两种方法的思路分别是找边和找点,简单点说就是,找到全集中最小的边(或者是距离最近的点),将他们连接起来,最终形成的树就是最小生成树。第一种方法,pr...

2018-08-23 11:03:39 409

原创 POJ2492(并查集)

Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gen...

2018-08-11 15:00:29 214

原创 POJ1984(带权值的并查集,)

Navigation Nightmare Time Limit: 2000MSMemory Limit: 30000K Total Submissions: 7647Accepted: 2753 Case Time Limit: 1000MS Description Farmer John’s pastoral neighborhood has N farms (2 <= ...

2018-08-11 14:48:39 341

原创 并查集模板(题目应用 POJ2524)

Ubiquitous Religions Time Limit: 5000MSMemory Limit: 65536K Total Submissions: 40520Accepted: 19302 Description There are so many different religions in the world today that it is difficult to...

2018-08-11 10:55:02 115

原创 贪心误区(POJ1456

Supermarket Time Limit: 2000MSMemory Limit: 65536K Total Submissions: 16486Accepted: 7416 Description A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈...

2018-08-11 10:22:54 157

原创 带有权值的并查集 POJ 1988 (Cube Stacking)

Cube Stacking Time Limit: 2000MSMemory Limit: 30000K Total Submissions: 27850Accepted: 9759 Case Time Limit: 1000MS Description Farmer John and Betsy are playing a game with N (1 <= N <...

2018-08-10 20:25:32 245

原创 POJ1182(食物链)

食物链 Time Limit: 1000MSMemory Limit: 10000K Total Submissions: 91075Accepted: 27380 Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 ...

2018-08-10 17:00:48 147

原创 AOJ2017(并查集,记录时间)

Problem F: You are given a tree T that consists of N nodes. Each node is numbered from 1 to N, and node 1 is always the root node of T. Consider the following two operations on T: M v: (Mark) Mark n...

2018-08-10 16:05:12 229

原创 POJ1703(并查集,经典问题,对立问题)

Find them, Catch them Time Limit: 1000MSMemory Limit: 10000K Total Submissions: 52870Accepted: 16192 Description The police office in Tadu City decides to say ends to the chaos, as launch acti...

2018-08-10 15:37:37 453

原创 POJ2236(并查集,逐一遍历)

Wireless Network Time Limit: 10000MSMemory Limit: 65536K Total Submissions: 38055Accepted: 15753 Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team)...

2018-08-10 15:02:48 469

原创 POJ2010(递增序列,求最优解)

Moo University - Financial Aid Time Limit: 1000MSMemory Limit: 30000K Total Submissions: 11694Accepted: 3455 Description Bessie noted that although humans have many universities they can atten...

2018-08-10 14:15:18 156

原创 POJ3416(贪心,优先队列,优先级处理)

Sunscreen Time Limit: 1000MSMemory Limit: 65536K Total Submissions: 11169Accepted: 3912 Description To avoid unsightly burns while tanning, each of the C (1 ≤ C ≤ 2500) cows must cover her hid...

2018-08-10 11:17:31 214

原创 HDOJ4496(并查集,反向求解)

D-City Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 5582 Accepted Submission(s): 1957Problem Description Luxer is a really bad guy. ...

2018-08-10 10:05:22 255

原创 POJ1988(并查集)记录个数

#include <iostream>#include <cstdio>#include <cstring>#define MAXN 30005using namespace std;int val[MAXN];int dis[MAXN];int ctn[MAXN];/*int mfind(int x){ int r = x; ...

2018-08-08 09:23:52 172

空空如也

空空如也

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

TA关注的人

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