自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 在Mac下配置wxWidgets环境

下载源码到官网下载相关源码安装编译环境为了编译wxWidgets,需要安装GTK(wxWidgets依赖)、cmake安装GTK1、安装Command Line Tool:xcode-select–install (如果安装过Xcode,可以忽略这一步) 2、安装Homebrew 使用Ruby脚本安装,Mac自带Ruby,因此直接执行指令:ru...

2018-03-28 22:54:40 2365

原创 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 273

原创 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 439

原创 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 234

原创 HDU 5775 Bubble Sort(冒泡排序的位置变换)

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem Description P is a permutation of the integers from 1 to N(index starting from 1). Here is the code of Bubble

2016-07-29 21:01:02 918

原创 HDU 5773 The All-purpose Zero(最长上升子序列)

Problem Description ?? gets an sequence S with n intergers(0 < n <= 100000,0<= S[i] <= 1000000).?? has a magic so that he can change 0 to any interger(He does not need to change all 0 to the same inte

2016-07-29 19:52:20 341

原创 HDU 5256 序列变换(最长上升子序列)

Problem Description 我们有一个数列A1,A2…An,你现在要求修改数量最少的元素,使得这个数列严格递增。其中无论是修改前还是修改后,每个元素都必须是整数。 请输出最少需要修改多少个元素。Input 第一行输入一个T(1≤T≤10),表示有多少组数据每一组数据:第一行输入一个N(1≤N≤105),表示数列的长度第二行输入N个数A1,A2,…,An。每一个数列中的元素都是正整数

2016-07-29 15:46:57 1081

原创 HDU 1527 取石子游戏(威佐夫博弈)

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem Description 有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜

2016-07-27 21:50:51 317

原创 HDU 2188 悼念512汶川大地震遇难同胞——选拔志愿者(巴什博奕)

Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Description 对于四川同胞遭受的灾难,全国人民纷纷伸出援助之手,几乎每个省市都派出了大量的救援人员,这其中包括抢险救灾的武警部队,治疗和防疫的医护人员,以及进行心理疏导的心理学专家。根据要求,我校也有一个奔赴灾

2016-07-27 20:38:07 464

原创 Educational Codeforces Round 5 D. Longest k-Good Segment(双指针)

time limit per test 1 second memory limit per test256 megabytes The array a with n integers is given. Let’s call the sequence of one or more consecutive elements in a segment. Also let’s call the se

2016-07-20 16:19:15 288

原创 CSU 1563 Lexicography

Description An anagram of a string is any string that can be formed using the same letters as the original. (We consider the original string an anagram of itself as well.) For example, the string ACM

2016-05-13 19:39:46 373

原创 Educational Codeforces Round 4 D. The Union of k-Segments

time limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given n segments on the coordinate axis Ox and the num

2016-04-08 22:01:42 419

原创 Codeforces Round #343 (Div. 2) B. Far Relative’s Problem(O(1)的线段标记)

time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard outputFamil Door wants to celebrate his birthday with his friends from Far Far Away. He has n frien

2016-03-24 21:55:09 345

原创 Codeforces Round #331 (Div. 2) C. Wilbur and Points

time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Wilbur is playing with a set of n points on the coordinate plane. All points have non-negat

2015-11-21 17:24:47 485

原创 UVA 512_Message Decoding

UVA 512

2015-11-12 19:03:22 437

原创 Codeforces Round #324 (Div. 2) C. Marina and Vasya

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMarina loves strings of the same length and Vasya loves when ther

2015-10-11 20:05:57 339

原创 Codeforces Round #324 (Div. 2) B. Kolya and Tanya

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputKolya loves putting gnomes at the circle table and giving them co

2015-10-09 22:02:22 271

原创 Codeforces Round #324 (Div. 2) A. Olesya and Rodion

time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOlesya loves numbers consisting of n digits, and Rodion only like

2015-10-09 21:51:00 265

原创 UVA 1588_Kickdown

题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=51983题目意思是说,给你两个每列高度为1或2的长条,让你塞进高度为3的容器里,问你这个容器最短要多长。只要分别以两个长条为基础,移动另外一个长条然后比对,计算出他们重合的部分,最后拿他们的总长度减去重合部分就是这个容器的长度了。然后这道题

2015-09-29 21:45:57 414

原创 Codeforces Round #320 (Div. 2) B. Finding Team Member

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a programing contest named SnakeUp, 2n people want to c

2015-09-17 21:54:24 757

原创 UVa 227_Puzzle

题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=19191其实,就是给你个矩阵,然后把里面的空格按照输入的指令移动,输出最后的矩阵,如果有的指令不合理,就输出一条信息。但是,果然字符串的处理能力很弱啊,搞了半天,要么就是输入不对,要么就是输出不对,最后还WA了个格式不对······#inc

2015-09-11 22:02:57 315

原创 Codeforces Round #316 (Div. 2) C. Replacement

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDaniel has a string s, consisting of lowercase English letters a

2015-08-14 16:00:55 255

原创 HDU 5373_The shortest problem

Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1009    Accepted Submission(s): 507Problem DescriptionIn this problem, we should s

2015-08-13 11:04:42 325

原创 HDU 5154_Harry and Magical Computer

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1676    Accepted Submission(s): 656Problem DescriptionIn reward of being yearly ou

2015-08-04 18:43:31 333

原创 HDU 5319_Painter

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 898    Accepted Submission(s): 410Problem DescriptionMr. Hdu is an painter, as we

2015-07-31 10:28:30 288

原创 HDU 5328_Problem Killer

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 299    Accepted Submission(s): 116Problem DescriptionYou are a "Problem Killer", y

2015-07-30 19:53:14 216

原创 HDU 5301_Buildings

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1360    Accepted Submission(s): 380Problem DescriptionYour current task is to ma

2015-07-24 22:12:22 367

原创 Codeforces Round #313 (Div. 2) C. Gerald's Hexagon

time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGerald got a very curious hexagon for his birthday. The boy foun

2015-07-23 20:25:03 309

原创 HDU 5289_Assignment

Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionTom owns a company and he is the boss. There are n staffs which are numbered from 1 to

2015-07-23 10:31:27 259

空空如也

空空如也

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

TA关注的人

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