自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 hihocoder #1084 (后缀数组求模糊匹配)

#1084 : 扩展KMP时间限制:4000ms单点时限:4000ms内存限制:256MB描述你知道KMP吗?它是用于判断一个字符串是否是另一个字符串的子串的算法。今天我们想去扩展它。在信息理论中,在两个相同长度的字符串之间的海明码距离是:两个字符串相同位置对应的字符不同的位置数目。换种说法,它表示将一个字符串转化为另一个字符串所需要

2014-12-14 23:27:25 756

原创 Topcoder SRM 640 Div2 1000(巧妙数学题)

Problem Statement  A multiset is the same thing as a set, with the difference that a multiset can contain multiple copies of the same element. For example, {1,1,1,2,3} is a multiset that c

2014-12-12 14:50:29 793

原创 Topcoder SRM 641 Div1 250(另辟蹊径,排除法)

Problem Statement  We have chosen a finite set of points in the plane. You are given their coordinates in the vector sx and y: for each valid i, there is a point with coordinates (x[i],y[i

2014-12-12 14:14:46 703

原创 UVALive 5908 Tracking RFIDs(计算几何+数据结构,暴力也可过)

A - Tracking RFIDsTime Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %lluSubmit Status Practice UVALive 5908Appoint description: System Crawler  (2014-12-04)Descri

2014-12-04 13:59:02 797

原创 Codeforces 484B. Maximum Value(高效二分搜索)

B. Maximum Valuetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a sequence a consisting of n 

2014-11-30 12:52:51 1326

原创 UVA 11997 Smallest Sums(有序表合并,多维变一维)

AA - K Smallest SumsTime Limit:1000MS     Memory Limit:0KB     64bit IO Format:%lld & %lluSubmit Status Practice UVA 11997Appoint description: System Crawler  (2014-11-25)Des

2014-11-27 15:42:01 408

原创 Codeforces 490D. Chocolate(分解质因数求解)

D. Chocolatetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarpus likes giving presents to Paraskevi.

2014-11-26 17:17:38 804

原创 Codeforces 487B. Strip(求区间最值+线段树上的dp)

题目:Codeforces 487B. Strip(#278Div.1 B题)描述:将一个长度为n的数列划分成m个部分,要求每个部分含有的个数>=L,且每个部分最大值-最小值<=S,求满足上述两个条件情况下m的最小值。即划分区间个数最小方法:线段树求区间最值,在线段树上进行动态规划,线段树懒操作复杂度:O(nlogn),n为数列元素个数此题所需方法巧妙,很有助于算法提高,有助于提高线段树基本写法

2014-11-23 02:50:00 1584

原创 HDU 4436 str2int(后缀数组,一种统计n个digit字符串所有不同子串之和的方法)

str2intTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1448    Accepted Submission(s): 500Problem DescriptionIn this problem,

2014-11-17 19:06:28 738

原创 Arab Collegiate Programming Contest 2012G. Archery(求雷达扫描的期望,区间离散化)

G. Archerytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLast summer you were watching all the matches in

2014-11-15 16:06:15 954

原创 Codeforces gym 2011-2012, Samara Interacademic Programming

Codeforces gym 2011-2012, Samara Interacademic Programming

2014-11-12 21:57:45 1441

原创 SGU 411Petya the Hero(最长公共回文子串,AC自动机+n^2判断回文)(学习后缀数组的前奏)

411. Petya the HeroTime limit per test: 0.25 second(s)Memory limit: 65536 kilobytesinput: standardoutput: standardPetya has come back from the Berland-Birland War, and now he is fond

2014-11-11 21:39:53 573

原创 Codeforces 383C. Propagating tree(树上hash映射+线段树懒操作)->(一种将树结点规律化的方法)

C. Propagating treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIahub likes trees very much. Recently h

2014-11-06 21:15:52 890 1

原创 Codeforces 128B. String(优先队列,模仿dijkstra求最短路)

B. Stringtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day in the IT lesson Anna and Maria learned a

2014-11-04 21:21:27 789

原创 Codeforces gym 2013-2014 Samara SAU ACM ICPC Quarterfinal Qualification Contest

今天遇到了件怪事

2014-10-27 02:29:55 2356

原创 Codeforces gym 2014 Nordic Collegiate Programming Contest(最初版,有过题再更新)

//Hello. I'm Peter.#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long lo

2014-10-25 20:13:50 641

原创 UVA 12304(计算几何大综合题)

//Hello. I'm Peter.#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long lo

2014-10-20 20:30:35 1088

原创 Topcoder SRM 152 Div2 1000(状态压缩呀)

Problem Statement  A large company is trying to put together a team of people to work on some task. In order for any team to work well, the people involved must be able to get along with eac

2014-10-19 00:48:11 467

原创 UVALive 3263(欧拉公式,V-E+F==2,几何模版 is under-construction...)

B - That Nice Euler CircuitTime Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %lluSubmit Status Practice UVALive 3263Appoint description: System Crawler  (2014-10-08)

2014-10-15 09:52:16 984

原创 Topcoder SRM 636 Div2 1000(切蛋糕,最后一块给自己。最小值中求最大值,二分+枚举)

Problem Statement  Mirosz adores sweets. He has just bought a rectangular bar of chocolate. The bar is divided into a grid of square cells. Different cells may have a different quality. Yo

2014-10-15 04:50:14 858

原创 UVA11019 Matrix Matcher(一种计算子矩阵在母矩阵中出现次数的办法,AC自动机+kmp)

Problem HMatrix MatcherInput: Standard InputOutput: Standard Output Given an N * M matrix, your task is to find the number of occurences of an X * Y pattern. InputThe first line contai

2014-10-12 00:32:33 480

原创 Topcoder SRM 148 Div2 1000(dfs搜索+hash判重)

Problem Statement  9 numbers need to be arranged in a magic number square. A magic number square is a square of numbers that is arranged such that every row and column has the same sum. Fo

2014-10-07 21:59:07 468

原创 Topcoder SRM 635 Div2 1000 (一种 O(n) 求一棵树中最长连续边 长度的方法)

//Hello. I'm Peter.#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long lo

2014-10-05 04:23:22 1023

原创 Codeforces 472D. Design Tutorial: Inverse the Problem(一种逆向判定树成立的办法,从Kruskal到dfs)

D. Design Tutorial: Inverse the Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is an easy wa

2014-09-29 14:11:12 796

原创 Codeforces 472B. Design Tutorial: Learn from Life(坐电梯扯淡题)

//Hello. I'm Peter.#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long lo

2014-09-29 03:27:14 699

原创 UVALive 3026 Period (KMP上的dp,学习ac自动机的前奏)

A BB - PeriodTime Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %lluSubmit Status Practice UVALive 3026Appoint description: System Crawler  (2014-09-22)Descr

2014-09-22 01:35:03 541

原创 Codeforces 467D. Fedor and Essay (Graphs,dfs,dp,hashing,strings,图论综合型好题)

D. Fedor and Essaytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter you had helped Fedor to find frien

2014-09-21 04:21:41 651

原创 POJ 3461 Oulipo (KMP,求模版串在文本串中可覆盖出现的次数,constructive)

OulipoTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 24213 Accepted: 9711DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La

2014-09-17 02:31:28 950

原创 CDOJ 251 导弹拦截 (LIS,一种找到字典序最小的最长上升子序列的方法)

导弹拦截Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others)Submit Status某国为了防御敌国的导弹袭击,开发出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都要高于前一发的

2014-09-17 01:21:37 2037 1

原创 HDU 3336 (KMP上的dp问题,ac自动机我来了)

Count the stringTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4845    Accepted Submission(s): 2295Problem DescriptionIt is wel

2014-09-15 04:08:12 666

原创 我知道怎么证明了!

http://acm.hdu.edu.cn/showproblem.php?pid=5011Nim游戏 基础上加了个步骤改天写证明

2014-09-14 21:46:19 400

转载 Nim游戏,异或解决问题,神证明

http://baike.baidu.com/view/1101962.htm?fr=aladdin#4Nim游戏编辑本词条缺少信息栏、名片图,补充相关内容使词条更完整,还能快速升级,赶紧来编辑吧!Nim游戏是博弈论中最经典的模型(之一),它又有着十分简单的规则和无比优美的结论 Nim游戏是组合游戏(Combinatorial Games)的一种,准

2014-09-14 19:32:21 2338

原创 CDOJ 843 冰雪奇缘 (线段树+懒操作+离散化)

冰雪奇缘Time Limit: 30000/10000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others)Submit Status艾莎女王又开始用冰雪魔法盖宫殿了。她决定先造一堵墙,于是释放魔法让形为直角梯形的冰砖从天而降,定入冻土之中。现在你将回答女王的询问:某段冻土上冰

2014-09-13 17:58:46 950

原创 Topcoder SRM 144 Div1 550(数学和dp问题求方案数,很有意思)

Problem Statement  In most states, gamblers can choose from a wide variety of different lottery games. The rules of a lottery are defined by two integers (choices andblanks) and two bool

2014-09-13 04:06:44 697

原创 Topcoder SRM 146 Div2 1000(dfs搜索,经典过桥问题,很有意思)

Problem Statement  A well-known riddle goes like this: Four people are crossing an old bridge. The bridge cannot hold more than two people at once. It is dark, so they can't walk without a

2014-09-12 21:16:57 536

转载 如何修改Mac截屏保存路径

MAC OS X系统默认的截图路径是桌面文件夹,默认的截图格式是 PNG 图片格式,如何自定义设置呢?截图保存路径打开终端(Terminal)并输入如下命令:defaults write com.apple.screencapture location /path//path/即你想要设置的保存路径,比如将截图文件存储在用户目录的图片(Pictures)文件

2014-09-12 19:15:39 575

原创 Codeforces 263 C. Circle of Numbers D. Cycle in Graph (dfs一般难度)

//Hello. I'm Peter.#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long lo

2014-09-09 22:07:18 764

原创 Codeforces 463D. Gargari and Permutations (dp,distinct下的LCS问题)

D. Gargari and Permutationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGargari got bored to play with

2014-09-08 23:37:16 587

原创 Codeforces 464B. Restore Cube (一种高效八点判断立方体(cube)的办法)

B. Restore Cubetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPeter had a cube with non-zero length of a s

2014-09-08 23:36:55 1016

原创 Codeforces 464A. No to Palindromes! (dp,向前推理,向后查询)

//Hello. I'm Peter.#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;typedef long lo

2014-09-08 23:31:55 557

空空如也

空空如也

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

TA关注的人

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