自定义博客皮肤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)
  • 收藏
  • 关注

原创 HDU 4763 Theme Section(kmp)

Time Limit:1000MS Memory Limit:32768KBDescription It’s time for music! A lot of popular musicians are invited to join us in the music festival. Each of them will play one of their representative s

2016-08-23 15:54:10 274

原创 Manacher算法

Manacher算法是专门用来处理回文的一种算法,其主要的作用是找出一个字符串里面最长的一个回文。要用到这个算法,首先要做的就是改变原来的字符串,就是在原有的字符串中,每两个字母之间都插入一个字符串里面没有的符号。比如:如果这个字符串是由26位字母组成的,那么就在第一个字母前和最后一个字母的后面以及每两个中间都插入一个#。举个栗子:s[]=”aaaaa”,那么这个字符串就改成:s[]=”#a#a#a

2016-08-21 21:17:10 291

原创 HDU 3068 最长回文(Manacher算法)

Time Limit:2000MS Memory Limit:32768KBDescription 给出一个只由小写英文字符a,b,c…y,z组成的字符串S,求S中最长回文串的长度. 回文就是正反读都是一样的字符串,如aba, abba等Input 输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c…y,z组成的字符串S 两组case之间由空行隔开(该空行不

2016-08-21 20:21:35 279

原创 HDU 5858 Hard problem(求角度的模板)

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem Description cjj is fun with math problem. One day he found a Olympic Mathematics problem for primary school stu

2016-08-20 15:33:50 314

原创 HDU 3374 String Problem(最大最小表示法+kmp)

Time Limit:1000MS Memory Limit:32768KBDescription Give you a string with length N, you can generate N strings by left shifts. For example let consider the string “SKYLONG”, we can generate seven s

2016-08-17 16:11:11 365

原创 HDU 4300 Clairewd’s message(kmp)

Time Limit:1000MS Memory Limit:32768KBDescription Clairewd is a member of FBI. After several years concealing in BUPT, she intercepted some important messages and she was preparing for sending it

2016-08-16 10:38:23 222

原创 HDU 2594 Simpsons’ Hidden Talents(kmp)

Time Limit:1000MS Memory Limit:32768KBDescription 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 ex

2016-08-15 19:42:40 201

原创 POJ 3080 Blue Jeans(暴力枚举+kmp)

Time Limit: 1000MS Memory Limit: 65536KDescription The Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousan

2016-08-15 14:11:12 222

原创 Codeforces Round #367 (Div. 2) D. Vasiliy's Multiset(字典树模板)

这里戳题目题意:首先给你一个集合,这个集合里面一开始只有零(一开始是有零的,别用个空的集合,并且这个集合允许有重复的值),然后有三种操作,如果输入时加号,就往这个集合新增一个数字,如果是减号,就把减号后的那个数字从集合里面去掉,如果是问号,就从集合里面找一个数,这个数字和问号后面的数字异或的结果是最大的。异或:意思是说有两个数字,如果不是二进制,就转化成二进制,然后两两比较,相同为零,不同为一,再转

2016-08-13 21:17:07 227

原创 Codeforces Round #367 (Div. 2) C. Hard problem(dp)

time limit per test1 second memory limit per test256 megabytesVasiliy is fond of solving different tasks. Today he found one he wasn’t able to solve himself, so he asks you to help.Vasiliy is given n

2016-08-12 19:43:52 308

原创 Codeforces Round #339 (Div. 2) D. Skills(模拟+枚举)

time limit per test2 seconds memory limit per test256 megabytesLesha plays the recently published new version of the legendary game hacknet. In this version character skill mechanism was introduced. N

2016-08-10 16:22:27 440

原创 HDU 5802 Windows 10(dfs)

题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5802题目意思是说,要调整音量,把音量从P调到Q。然后调整音量的规则是,如果是向上调整音量,每秒可以调整1dB,但是如果是向下调整音量,就可以从1开始,如果这次调整的音量是X,那下一次就可以调整2*XdB的音量,但是如果你停顿了,或者向上调整音量,再向下调整,那么就又要从1开始调整音量了。这道题按照题解

2016-08-05 16:39:27 339

原创 HDU 5793 A Boring Question(快速幂+求逆元)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5793这道题就是给你一个公式,然后再给数据范围给你,然后求答案。这道题的公式推到最后就是一个等比数列的求和公式,也就是说,输入n和m,然后从m的0次方一直加到n次方的和就是答案。但是由于这道题的数据太大了,有1e9,所以我们不可能用for循环一直加到最后,所以根据公式,我们需要用到快速幂来求m^n。用快速

2016-08-04 19:08:57 903

原创 HDU 5792 World is Exploding(树状数组)

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem Description Given a sequence A with length n,count how many quadruple (a,b,c,d) satisfies: a≠b≠c≠d,1≤a< b≤n, 1

2016-08-04 11:25:27 235

空空如也

空空如也

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

TA关注的人

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