自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

HJY

一只想要翻身的咸鱼

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

原创 HDU 1238 Substrings(暴力+stl)

You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings.

2017-08-22 09:56:03 271

原创 Educational Codeforces Round 27 C. Two TVs(模拟)

Polycarp is a great fan of television.He wrote down all the TV programs he is interested in for today. His list contains n shows, i-th of them starts at moment li and ends at moment ri.Polycarp owns two TVs. He can watch two different shows simultaneous

2017-08-22 00:17:37 748 1

原创 Educational Codeforces Round 27 B. Luba And The Ticket(模拟)

Luba has a ticket consisting of 6 digits. In one move she can choose digit in any position and replace it with arbitrary digit. She wants to know the minimum number of digits she needs to replace in order to make the ticket lucky.The ticket is considered

2017-08-22 00:12:38 491

原创 HDU 4300 Clairewd’s message(扩展KMP)

Clairewd is a member of FBI. After several years concealing in BUPT, she intercepted some important messages and she was preparing for sending it to ykwd. They had agreed that each letter of these messages would be transfered to another one according to a

2017-08-21 20:57:33 301

原创 HDU 3336 Count the string(KMP+稍微DP+next数组的运用)

It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example: s: "abab" The prefixes are: "a", "ab", "aba", "abab" For each

2017-08-21 19:28:16 239

原创 HDU 2594 Simpsons’ Hidden Talents(KMP)

Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had. Marge: Yeah, what is it? Homer: Take me for example. I want to find out if I have a talent in politics, OK? Marge: OK. Homer: So I take some politician’s na

2017-08-21 19:09:27 232

原创 POJ 3080 Blue Jeans(暴力模拟+stl)

The Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousands of contributors to map how the Earth was populated. As an IBM researcher, you have been tasked with writing

2017-08-21 18:50:48 350

原创 POJ 2752 Seek the Name, Seek the Fame(KMP+next数组的运用)

The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time seek the fame. In order to escape from such boring job, the inn

2017-08-21 15:32:08 305

原创 POJ 2406 Power Strings(KMP+最小循环节)

Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the normal way: a^0 = ""

2017-08-21 15:14:33 318

原创 HUST 1010 The Minimum Length(KMP)

There is a string A. The length of A is less than 1,000,000. I rewrite it again and again. Then I got a new string: AAAAAA...... Now I cut it from two different position and get a new string B. Then, give you the string B, can you tell me the length of the

2017-08-21 14:30:02 272

原创 HDU 1358 Period(KMP+next数组的运用)

For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 <= i <= N) we want to know the largest K > 1 (if there i

2017-08-21 11:12:58 228

原创 HDU 3746 Cyclic Nacklace(KMP)

CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and thinking about how to tide over the last days. Being inspired by the entrepre

2017-08-21 10:04:44 259

转载 KMP算法入门详解

通俗易懂的KMP详解

2017-08-20 15:02:19 332

原创 CCPC网赛 CaoHaha's staff(找规律+模拟扩展正方形)

"You shall not pass!" After shouted out that,the Force Staff appered in CaoHaha's hand. As we all know,the Force Staff is a staff with infinity power.If you can use it skillful,it may help you to do whatever you want. But now,his new owner,CaoHaha,is a

2017-08-19 21:07:48 742

原创 CCPC网赛 Friend-Graph(图论+模拟+输入外挂)

It is well known that small groups are not conducive of the development of a team. Therefore, there shouldn’t be any small groups in a good team. In a team with n members,if there are three or more members are not friends with each other or there are thre

2017-08-19 18:13:14 420

原创 POJ 3145Harmony Forever(线段树更新+分情况处理数据+区间极值查询+好题)

We believe that every inhabitant of this universe eventually will find a way to live together in harmony and peace; that trust, patience, kindness and loyalty will exist between every living being of this earth; people will find a way to appreciate and coo

2017-08-18 20:34:16 469

原创 HDU 1281 棋盘游戏(二分图匹配+匈牙利算法+模拟)

小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有些格子是可以避开的,也就是说,不在这些格子上放车,也可以保证尽量多的“车”被放下。但是某些格子若不放子,就无法保证放尽量多的“车”,这样的格子被称做重要点。Gar

2017-08-18 10:33:48 266

原创 HDU 1179 Ollivanders: Makers of Fine Wands since 382 BC.(二分图匹配+匈牙利算法)

In Diagon Alley ,there is only one Wand-seller,peeling gold letters over the door read Ollivanders: Makers of Fine Wands since 382 BC.A single wand lay on a faded purple cushion in the dusty window. A tinkling bell rang somewhere in the depths of the shop

2017-08-18 09:16:17 316

原创 POJ 1861 Network(最小生成树+克鲁斯卡尔)

Andrew is working as system administrator and is planning to establish a new network in his company. There will be N hubs in the company, they can be connected to each other using cables. Since each worker of the company must have access to the whole netwo

2017-08-17 21:16:18 249

原创 HDU 1543 Paint the Wall(离散化+暴力)

Here comes our future artist. See, he is painting again, this time on home's white wall, using different color of paint. Let me see, red, yellow, black, green... but why does he just paint rectangles? Pretty guy, seems he is fond of it.So, after he's done

2017-08-17 20:20:47 555

原创 ZOJ 3721 Final Exam Arrangement(模拟+贪心)

In Zhejiang University, there are N different courses labeled from 1 to N. Each course has its own time slot during the week. We can represent the time slot of a course by an left-closed right-open interval [s, t).Now we are going to arrange the final exa

2017-08-17 20:03:09 313

原创 ZOJ 3453 Doraemon's Sweet Bullet(线段树区间更新+单点更新+最值询问)

Doraemon likes to shoot his enemies with sweet bullets.n "enemies" stand in a line, each with a life value li (the index i increases from left to right side and starts from 1). Each time Doraemon shoots a sweet bullet from the right side. The ith bullet h

2017-08-17 19:53:11 229

原创 HDU 2488 A Knight's Journey(dfs)

The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. Whenever a knight moves, it is two squares in one direction and one square perpendicular to this. The world of a kni

2017-08-17 19:42:56 330

原创 HDU-1255 覆盖的面积(线段树扫描线+离散化+改进后超快的算法)

给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.

2017-08-17 10:09:09 513

原创 HDU-1255 覆盖的面积(线段树扫描线模板+离散化+加点修改题)

给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.

2017-08-16 17:13:06 418

原创 POJ 2482 Stars in Your Window(线段树扫描线+最浪漫的题意)

Fleeting time does not blur my memory of you. Can it really be 4 years since I first saw you? I still remember, vividly, on the beautiful Zhuhai Campus, 4 years ago, from the moment I saw you smile, as you were walking out of the classroom and turned your

2017-08-16 14:57:57 1671 1

原创 POJ 1422 Air Raid(二分图匹配+最小路径覆盖+匈牙利算法)

Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an intersection and walking through town's streets you can never reach the same intersection i.e. the town's stree

2017-08-15 20:58:37 340

原创 ZOJ 3432 Find the Lost Sock(模拟)

Alice bought a lot of pairs of socks yesterday. But when she went home, she found that she has lost one of them. Each sock has a name which contains exactly 7 charaters.

2017-08-15 19:42:30 228

原创 POJ 1111 Image Perimeters(dfs+求连通块的周长)

Technicians in a pathology lab analyze digitized images of slides. Objects on a slide are selected for analysis by a mouse click on the object. The perimeter of the boundary of an object is one useful measure. Your task is to determine this perimeter for s

2017-08-15 19:36:18 426

原创 POJ 1383 Labyrinth(两次bfs求最长路径)

The northern part of the Pyramid contains a very large and complicated labyrinth. The labyrinth is divided into square blocks, each of them either filled by rock, or free. There is also a little hook on the floor in the center of every free block. The ACM

2017-08-15 19:29:53 993 1

原创 codeforces-305A Strange Addition(思维+模拟)

Unfortunately, Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place. For example, Vasya can sum numbers 505 and 50, but he cannot sum 1 and 4.Vasya has a set of k distinct non-negative

2017-08-15 19:24:19 331

原创 HDU 1068 Girls and Boys(二分图匹配+最大独立集+匈牙利算法)

the second year of the university somebody started a study on the romantic relations between the students. The relation “romantically involved” is defined between one girl and one boy. For the study reasons it is necessary to find out the maximum set satis

2017-08-15 09:03:35 632

原创 HDU 4819 Mosaic(二维线段树单点更新+区间查询+自己的写法模板)

The God of sheep decides to pixelate some pictures (i.e., change them into pictures with mosaic). Here's how he is gonna make it: for each picture, he divides the picture into n x n cells, where each cell is assigned a color value. Then he chooses a cell,

2017-08-14 21:22:02 443

原创 HDU1823 Luck and Love(二维线段树单点更新+区间查询+模板)

世界上上最远的距离不是相隔天涯海角 而是我在你面前 可你却不知道我爱你 ―― 张小娴 前段日子,枫冰叶子给Wiskey做了个征婚启事,聘礼达到500万哦,天哪,可是天文数字了啊,不知多少MM蜂拥而至,顿时万人空巷,连扫地的大妈都来凑热闹来了。―_―||| 由于人数太多,Wiskey实在忙不过来,就把统计的事情全交给了枫冰叶子,自己跑回家休息去了。这可够枫冰叶子忙的了,他要处理的有两类事情,一是得接受MM的报名,二是要帮Wiskey查找符合要求的MM中缘分最高值。

2017-08-14 19:00:17 599

原创 Codeforces Round #428 (Div. 2) C.Journey(dfs求期望)

C. Journeytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n cities and n - 1 roads in the Seven Kingdoms, each road connects two cities and we can reach any city from any other by the roa

2017-08-13 21:18:39 375

原创 POJ 3465 Battle(优先队列+贪心模拟)

You're Zhu Rengong, a formidable hero. After a number of challenging missions, you are finally facing the final Boss – a black dragon called Heilong. Due to his overwhelming power, you have to plan your actions carefully.You have H1 hit points (HP) at the

2017-08-13 19:09:45 427

原创 POJ 2442 Sequence(stl+优先队列||堆)

Given m sequences, each contains n non-negative integer. Now we may select one number from each sequence to form a sequence with m integers. It's clear that we may get n ^ m this kind of sequences. Then we can calculate the sum of numbers in each sequence,

2017-08-13 18:47:56 462

原创 Codeforces Round #428 (Div. 2) B.Game of the Rows(贪心+炒鸡多坑的模拟)

B. Game of the Rowstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDaenerys Targaryen has an army consisting of k groups of soldiers, the i-th group contains ai soldiers. She wants to bring her army

2017-08-13 10:28:02 544

原创 关于数据结构和图论的一些入门攻略

我是负责我们队数据结构和图论的,在集训队做了一个多月的题,应该算是图论和数据结构入门了吧,这里我推荐一些图论和数据结构的算法学习顺序(我的见解),如果对这一方面有兴趣的可以看一看。(日常菜的抠脚不想去刷题)

2017-08-12 19:32:38 2127 1

原创 POJ 2446 Chessboard(二维转一维+二分匹配+匈牙利算法)

Alice and Bob often play games on chessboard. One day, Alice draws a board with size M * N. She wants Bob to use a lot of cards with size 1 * 2 to cover the board. However, she thinks it too easy to bob, so she makes some holes on the board (as shown in th

2017-08-11 16:18:52 438

空空如也

空空如也

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

TA关注的人

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