自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Who's in the Middle POJ2388

Who's in the MiddleTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmit StatusDescriptionFJ is surveying his herd to find the most averag

2016-11-30 22:41:25 394

原创 All in All POJ1936

All in AllTime Limit: 1000MS Memory Limit: 30000KB 64bit IO Format: %lld & %lluSubmit StatusDescriptionYou have devised a new encryption technique which encodes

2016-11-30 22:25:03 237

原创 食物链 POJ1182(带权并查集)

食物链Time Limit: 1000MS Memory Limit: 10000KB 64bit IO Format: %lld & %lluSubmit StatusDescription动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。

2016-11-27 23:17:59 280

原创 The Suspects POJ1611(简单并查集)

The SuspectsTime Limit: 1000MS Memory Limit: 20000KB 64bit IO Format: %lld & %lluSubmit StatusDescriptionSevere acute respiratory syndrome (SARS), an atypical p

2016-11-27 16:49:51 360

原创 UVALive 3644 X-Plosives(简单并查集)

题目大意:把一些两个元素组成的化合物按输入次序往车上装,如果会发生爆炸(存在k个简单化合物,正好包含k种元素),记录,输出不能装车的化合物总数。做法:由于是其中K各简单化合物中包含K个元素,仔细一想就是并查集,把已经出现的点合成一个集合,对于新出现的两个值,如果两个值同时在一个集合中(注意可能不止一个集合),那么在这个集合中就肯定能找到另外几对数值使得他们与这一对数值构成一个环,如现在

2016-11-27 15:50:45 390

原创 POJ 2531 Network Saboteur (dfs+水题)

Network SaboteurTime Limit: 2000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmit StatusDescriptionA university network is composed of N computers. Sy

2016-11-20 22:56:32 393

原创 HDU 1057 What Are You Talking About(字典树)

What Are You Talking AboutTime Limit: 5000MS Memory Limit: 204800KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionIgnatius is so lucky that he met a Mar

2016-11-19 20:09:58 368

原创 C++ 每次读取一行字符串输入

stream中的类(如cin)提供了一些面向行的类成员函数:getline()和get()。这两个函数都读取一行输入,直到到达换行符。getline()和get()函数不同的是:getline()将丢弃换行符,而get()将换行符保留在输入序列中1.面向行的输入:getline()getline()函数读取整行,它使用通过回车键输入的换行符来确定输入结尾调用方式:cin.g

2016-11-19 18:46:32 27658

原创 HDU1671 Phone List(字典树)

Phone ListTime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionGiven a list of phone numbers, determine if it is consi

2016-11-19 16:48:37 298

原创 HDU1274 Hat’s Words(字典树 数组实现)

Hat’s WordsTime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionA hat’s word is a word in the dictionary that is the c

2016-11-19 14:33:57 331

原创 HDU1251 统计难题(字典树模板题--数组实现+指针实现)

统计难题Time Limit: 2000MS Memory Limit: 65535KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字

2016-11-18 22:18:04 412

转载 C语言 gets()和scanf()函数的区别

C语言 gets()和scanf()函数的区别scanf( )函数和gets( )函数都可用于输入字符串,但在功能上有区别。若想从键盘上输入字符串"hi hello",则应该使用__gets__函数。gets可以接收空格;而scanf遇到空格、回车和Tab键都会认为输入结束,所有它不能接收空格。char string[15]; gets(string); /*遇到回车认为输入结

2016-11-18 20:15:31 298

原创 POJ2485 Highways 最小生成树

HighwaysTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 29353 Accepted: 13370DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately

2016-11-13 14:44:07 293

原创 POJ1789 Truck History 最小生成树

Truck HistoryTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 25988 Accepted: 10083DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different ty

2016-11-13 14:38:06 261

原创 POJ2051 Argus 优先队列

ArgusTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 11204 Accepted: 5407DescriptionA data stream is a real-time, continuous, ordered sequence of item

2016-11-13 10:38:01 357

原创 POJ1251 JungleRoads 最小生成树

Jungle RoadsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 24542 Accepted: 11540DescriptionThe Head Elder of the tropical island of Lagrishan has

2016-11-13 10:31:34 413

原创 poj1258 Agri-Net 最小生成树

Agri-NetTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 54134 Accepted: 22479DescriptionFarmer John has been elected mayor of his town! One of his cam

2016-11-13 10:24:43 326

原创 UVA11997 - K Smallest Sums 优先队列,多路归并

题目要求是从k个数组中各选一个数组成的和中最小的k个。用到的是多路归并算法,详见汝佳神白书。先看看两个数组的情况,就会有如下几个表单表1:A1+B1表2: A2+B1...................................表k:Ak+B1     可以很容易的知道,这里有K个表单(因为数组有K个元素),并且每个表单的最小值都是第一个(因

2016-11-13 09:52:41 341

原创 UVA11991 - Easy Problem from Rujia Liu?(数据结构,模拟)

题意:        给你n个数(n解法:我的第一想法是用数组模拟,即d[v][k];但是似乎没有这么大的二维数组,而且也并不知道V到底有多少个,所以用了个向量Vector,本来是不抱任何希望的,没想到A了,果然是水题。。。。第一次代码:#include#include#include#includeusing namespace std;cons

2016-11-09 21:27:06 284

原创 UVA11995 I Can Guess the Data Structure!(数据结构,模拟)

I Can Guess the Data Structure!There is a bag-like data structure, supporting two operations:1 xThrow an element x into the bag.2Take out an element from the bag.Given a sequence

2016-11-09 20:19:25 386

原创 Arbitrage POJ2240 bellman_ford

ArbitrageTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 21566 Accepted: 9185DescriptionArbitrage is the use of discrepancies in currency exchange rat

2016-11-09 17:24:45 403

原创 Currency Exchange POJ1860 bellman_ford

Currency ExchangeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 27630 Accepted: 10257DescriptionSeveral currency exchange points are working in our c

2016-11-09 15:23:45 414

原创 POJ1125 Stockbroker Grapevine

Stockbroker GrapevineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 34735 Accepted: 19261DescriptionStockbrokers are known to overreact to rumours. Y

2016-11-08 17:48:50 527

原创 POJ1062昂贵的聘礼)

昂贵的聘礼Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 46450 Accepted: 13781Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿

2016-11-07 22:50:57 228

原创 HDU2066一个人的旅行

一个人的旅行Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 33498    Accepted Submission(s): 11513Problem Description虽然草儿是个路痴(就是在杭电待了一

2016-11-02 18:47:35 288

原创 HDU2544最短路模板题

最短路Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 56555    Accepted Submission(s): 24980Problem Description在每年的校赛里,所有进入决赛的同学都会获

2016-11-02 15:17:16 375

空空如也

空空如也

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

TA关注的人

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