自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

AK_HuangYC的博客

人一我十,人十我百

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

原创 HDU 3006 The Number of set (状态压缩dp)

这题真是让我看到了位运算和状压DP的神奇之处! 这题就是用一个二进制数保存一个集合的元素 比如一个集合中有两个元素   1  3   那就用5 (101)表示这个集合 就是用0 1 来表示这个集合中一个数存不存在 再比如 一个集合有 三个元素 1 4 5 就在这几个位子上标为1,那就用25 (11001)来表示这个集合!在借助于位运算的或( |  )就可已达到合并集合的目的

2015-07-31 09:48:19 343

原创 HDU Rightmost Digit (快速幂)

Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T

2015-07-30 16:10:44 391

原创 HDU 本原串 (快速幂)

Problem Description由0和1组成的串中,不能表示为由几个相同的较小的串连接成的串,称为本原串,有多少个长为n(n答案mod2008.例如,100100不是本原串,因为他是由两个100组成,而1101是本原串。Input输入包括多个数据,每个数据一行,包括一个整数n,代表串的长度。Output对于每个测试数据,输出一行,代表有多少

2015-07-30 16:07:04 424

原创 HDU 3038 How Many Answers Are Wrong (并查集)

题目大意:有n次询问,给出a到b区间的总和,问这n次给出的总和中有几次是和前面已近给出的是矛盾的??Problem DescriptionTT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to p

2015-07-29 10:57:24 283

原创 HDU 3635 Dragon Balls (并查集)

题目大意:初始时,有n个龙珠,编号从1到n,分别对应的放在编号从1到n的城市中。现在又2种操作:T A B,表示把A球所在城市全部的龙珠全部转移到B城市。(第一次时,因为A球所在的城市只有一个球,所以只移动1个,如果有多个,则全部移动)。Q A,表示查询A。要求得到的信息分别是:A现在所在的城市,A所在城市的龙珠数目,A转移到该城市移动的次数(如果没有移动就输出0)

2015-07-28 17:15:43 379

原创 HDU 1829 A Bug's Life (并查集)

题意:题意:有n个人,给你m对关系,问有没有同性恋的。 Problem DescriptionBackground Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders

2015-07-28 11:51:38 457 1

原创 HDU 2818 Building Block (并查集)

Problem DescriptionJohn are playing with blocks. There are N blocks (1 M X Y : Put the whole pile containing block X up to the pile containing Y. If X and Y are in the same pile, just ignore t

2015-07-28 10:17:09 419

原创 HDU 小希的迷宫 (并查集)

Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路

2015-07-27 16:43:39 391

原创 hdu 1213 How Many Tables (并查集)

Problem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the fri

2015-07-27 15:28:52 311

原创 HDU1232 畅通工程 (并查集)

Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?  Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N (

2015-07-27 15:15:47 430 1

原创 ZOJ 1649 Rescue BFS (搜索)

Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M Angel's friends want to save Angel. Their task is: approach Angel. We assume that "approach

2015-07-27 15:03:09 545

原创 POJ 1979 Red and Black (DFS)

/*简单的dfs题,注意map数组清零注意题目中地图输入的行列顺序,陷阱!*/DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From

2015-07-26 12:24:20 343

原创 HDU pie (二分查找)

Problem DescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my

2015-07-25 15:16:15 480

原创 ZOJ 2412 Farm Irrigation (DFS+模拟)

Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these squares. Different square has a different type o

2015-07-25 15:09:31 382 1

原创 hdu An easy problem (背包)

Problem DescriptionWhen Teddy was a child , he was always thinking about some simple math problems ,such as “What it’s 1 cup of water plus 1 pile of dough ..” , “100 yuan buy 100 pig” .etc..

2015-07-24 19:39:11 443

原创 hdu Piggy-Bank (背包)

Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). Th

2015-07-24 19:39:02 479

原创 hdu Robberies (背包)

Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided t

2015-07-24 19:36:56 579 1

原创 hdu I NEED A OFFER! (背包)

Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了

2015-07-24 19:36:27 412

原创 hdu 饭卡 (背包)

Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。Inp

2015-07-24 19:35:28 843 1

原创 zoj 1562 Oil Deposits (DFS)

DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid

2015-07-24 19:32:28 455

原创 hdu 1010 Tempter of the Bone (DFS)

Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He

2015-07-24 19:29:33 264

原创 hdu 吉哥系列故事——完美队形 (最长公共子序列)

Problem Description  吉哥这几天对队形比较感兴趣。  有一天,有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则称之为完美队形:    1、挑出的人保持他们在原队形的相对顺序不变;  2、左右对称,假设有m个人形成新的队形,则第1个人和第m个

2015-07-24 19:22:15 474

空空如也

空空如也

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

TA关注的人

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