自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

SCUT_Pein

走好自己的路,勿迷失于他人风景、

  • 博客(493)
  • 资源 (4)
  • 收藏
  • 关注

原创 3110: [Zjoi2013]K大数查询

Description有N个位置,M个操作。操作有两种,每次操作如果是1 a b c的形式表示在第a个位置到第b个位置,每个位置加入一个数c如果是2 a b c形式,表示询问从第a个位置到第b个位置,第C大的数是多少。Input第一行N,M接下来M行,每行形如1 a b c或2 a b cOutput输出每个询问的结果Sample Input

2015-09-23 20:24:49 638 1

原创 2002: [Hnoi2010]Bounce 弹飞绵羊(分块)

Description某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏。游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置设定初始弹力系数ki,当绵羊达到第i个装置时,它会往后弹ki步,达到第i+ki个装置,若不存在第i+ki个装置,则绵羊被弹飞。绵羊想知道当它从第i个装置起步时,被弹几次后会被弹飞。为了使得游戏更

2015-09-21 10:39:27 697

原创 ural1960Palindromes and Super Abilities(回文树)

回文树根据以下博客学的,写得很好传送门:http://blog.csdn.net/u013368721/article/details/42100363After solving seven problems on Timus Online Judge with a word “palindrome” in the problem name, Misha has got an un

2015-07-30 00:41:52 1221

原创 GDCPC2015

这两天忙着赶实习的任务。所以总结就拖到现在了。先简单记录下比赛吧。这次队名改成了Hold_the_crash。背后的故事这里就不说了= =。本场也是12题。依旧是WJ前4,我中4,SF后4。开场就看E。水题一个。就上去搞。太久没打现场赛有点虚,多测了几组数据。19min/1A。然后榜上有不少人过了L。SF开艹。wa了发。我看了下,感觉似乎不用按顺序。SF改了下43min/2A。然后

2015-05-27 16:43:17 1025

转载 几种常见取石子模型

由poj 1067引发的——取石子游戏【各类取石子总结】上次做poj 1067的取石子游戏,只用到了whthoff博弈,未涉及到取石子的异或方法,今天重新搜索,整理了一遍。搜罗各种资料,加上自己整理,终于成篇啦!……噼里啪啦 取石子问题有一种很有意思的游戏,就是有物体若干堆,可以是火柴棍或是围棋子等等均可。两个人轮流从堆中取物体若干,规定最后取光

2015-03-30 11:31:33 766

原创 大视野1096--[ZJOI2007]仓库建设(斜率优化DP)

DescriptionL公司有N个工厂,由高到底分布在一座山上。如图所示,工厂1在山顶,工厂N在山脚。 由于这座山处于高原内陆地区(干燥少雨),L公司一般把产品直接堆放在露天,以节省费用。突然有一天,L公司的总裁L先生接到气象部门的电话,被告知三天之后将有一场暴雨,于是L先生决定紧急在某些工厂建立一些仓库以免产品被淋坏。由于地形的不同,在不同工厂建立仓库的费用可能是不同的。第i个工厂目前已

2015-02-03 11:30:01 572

原创 HDU2191(单调队列优化DP)

Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴

2015-01-31 16:31:19 665

转载 [转]中国剩余定理

中国剩余定理可以描述为:若某数x分别被d1、、…、dn除得的余数为r1、r2、…、rn,则可表示为下式:x=R1r1+R2r2+…+Rnrn+RD其中R1是d2、d3、…、dn的公倍数,而且被d1除,余数为1;(称为R1相对于d1的数论倒数)R1 、R2 、…  、Rn是d1、d2、…、dn-1的公倍数,而且被dn除,余数为1;D是d1、d2、…、的最小公倍数;

2015-01-27 13:41:03 1315

转载 [转]欧拉函数公式及其证明

欧拉函数:欧拉函数是数论中很重要的一个函数,欧拉函数是指:对于一个正整数 n,小于 n且和 n互质的正整数(包括 1)的个数,记作φ(n)。完全余数集合:定义小于 n且和 n互质的数构成的集合为 Zn,称呼这个集合为 n的完全余数集合。显然 |Zn|=φ(n)。有关性质:对于素数 p,φ(p) = p-1。对于两个不同

2015-01-27 10:44:26 1178

转载 [转]扩展欧几里得

欧几里德算法欧几里德算法又称辗转相除法,用于计算两个整数a,b的最大公约数。gcd函数就是用来求(a,b)的最大公约数的。 gcd函数的基本性质:性质一:gcd(a,b)=gcd(b,a)=gcd(-a,b)=gcd(|a|,|b|)证明略。 性质二:gcd(a,b)=gcd(b,a mod b)证明:a可以表示成a = kb + r

2015-01-26 22:13:40 443

原创 HDU2255--奔小康赚大钱(KM算法)

Problem Description传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到一间房子。另一方面,村长和另外的村领导希望得到最大的效益,这样村里的机构才会有钱.由于

2015-01-26 12:43:22 526

原创 POJ1160--Post Office(四边形不等式优化)

DescriptionThere is a straight highway with villages alongside the highway. The highway is represented as an integer axis, and the position of each village is identified with a single integer coor

2015-01-24 22:51:07 1036

原创 HDU3507--Print Article(斜率优化DP)

Problem DescriptionZero has an old printer that doesn't work well sometimes. As it is antique, he still like to use it to print articles. But it is too old to work for a long time and it will cert

2015-01-23 23:21:40 606

原创 2014ACM-ICPC牡丹江+鞍山总结

10月8号:    晚上8点出发。坐火车!!好怀念让我们坐飞机的老院长。。。    10.9~10.10    想想这是我第一次坐火车。从广州到哈尔滨整整坐了40多钟,晚点7小时也是醉了。。10号下午2点多才到哈尔滨,从哈尔滨去牡丹江的火车也已经开了!我们只能搭下一班。。。随便找了间又贵又难吃的店挫了顿然后就四处游荡、、    改了晚上6点的火车去牡丹江,硬座。    晚上11

2014-10-29 00:25:50 5614 4

转载 HDU1007--最小点对

Problem DescriptionHave you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded.In the field of Cyberground, the

2014-10-15 19:28:04 803

原创 SPOJ--Count on a tree II(树上莫队)

Description You are given a tree with N nodes.The tree nodes are numbered from 1 to N.Each node has an integer weight.We will ask you to perfrom the following operation:u v : ask for how

2014-10-14 00:50:13 887

原创 SETI--后缀数组

-Problem Description      Amateur astronomers Tom and Bob try to find radio broadcasts of extraterrestrial civilizations in the air. Recently they received some strange signal and represented

2014-10-07 13:49:15 667

原创 HDU4787--GRE Words Revenge(在线AC自动机)

Problem Description  Now Coach Pang is preparing for the Graduate Record Examinations as George did in 2011. At each day, Coach Pang can:  "+w": learn a word w  "?p": read a paragraph p, and c

2014-09-29 15:55:31 1187

原创 HDU5044--Tree(树链剖分)

Problem DescriptionYou are given a tree (an acyclic undirected connected graph) with N nodes. The tree nodes are numbered from 1 to NThere are N - 1 edges numbered from 1 to N - 1.Each nod

2014-09-27 18:38:59 942

原创 HDU5029--Relief grain(树链剖分)

Problem DescriptionThe soil is cracking up because of the drought and the rabbit kingdom is facing a serious famine. The RRC(Rabbit Red Cross) organizes the distribution of relief grain in the disas

2014-09-23 17:58:26 1335

原创 HDU5002--Tree(LCT)

Problem DescriptionYou are given a tree with N nodes which are numbered by integers 1..N. Each node is associated with an integer as the weight.Your task is to deal with M operations of 4 type

2014-09-22 16:44:33 591

原创 CF468B--Two Sets

Little X has n distinct integers: p1, p2, ..., pn. He wants to divide all of them into two sets A and B. The following two conditions must be satisfied:If number x belongs to set A, then num

2014-09-21 18:16:44 834

原创 HDU5008--Boring String Problem(SA+二分)

Problem DescriptionIn this problem, you are given a string s and q queries.For each query, you should answer that when all distinct substrings of string s were sorted lexicographically, which

2014-09-15 18:59:34 1499

转载 博弈问题及SG函数

博弈问题若你想仔细学习博弈论,我强烈推荐加利福尼亚大学的Thomas S. Ferguson教授精心撰写并免费提供的这份教材,它使我受益太多。(如果你的英文水平不足以阅读它,我只能说,恐怕你还没到需要看“博弈论”的时候。)Nim游戏是博弈论中最经典的模型(之一?),它又有着十分简单的规则和无比优美的结论,由这个游戏开始了解博弈论恐怕是最合适不过了。Nim游戏是组合游戏(Comb

2014-09-14 20:09:04 748

原创 HDU5001--Walk

Problem DescriptionI used to think I could be anything, but now I know that I couldn't do anything. So I started traveling.The nation looks like a connected bidirectional graph, and I am rando

2014-09-13 18:27:12 1026 4

原创 HDU4424--Conquer a New Region

DescriptionThe wheel of the history rolling forward, our king conquered a new region in a distant continent. There are N towns (numbered from 1 to N) in this region connected by several roads. I

2014-09-12 20:44:25 578

原创 [2009国家集训队]小Z的袜子--莫队算法

Description作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命……具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否一左一右,他却很在意袜子的颜色,毕竟穿两只不同色的袜子会很尴尬。你的任务便是告诉小Z

2014-09-05 22:02:24 3385

原创 POJ3241--Object Clustering(曼哈顿最小生成树)

DescriptionWe have N (N ≤ 10000) objects, and wish to classify them into several groups by judgement of their resemblance. To simply the model, each object has 2 indexes a and b (a, b ≤ 500). The

2014-09-04 18:36:58 688

原创 UVA11990--"Dynamic"Inversion

You are given a permutation {1,2,3,...,n}. Remove m of them one by one, and output the number of inversion pairs before each removal. The number of inversion pairs of an array A is the number of order

2014-08-24 19:05:06 926

原创 POJ1830--开关问题

Description有N个相同的开关,每个开关都与某些开关有着联系,每当你打开或者关闭某个开关的时候,其他的与此开关相关联的开关也会相应地发生变化,即这些相联系的开关的状态如果原来为开就变为关,如果为关就变为开。你的目标是经过若干次开关操作后使得最后N个开关达到一个特定的状态。对于任意一个开关,最多只能进行一次开关操作。你的任务是,计算有多少种可以达到指定状态的方法。(不计开关操作的顺序

2014-08-10 22:43:36 614

原创 CF 455C--Civilization

Andrew plays a game called "Civilization". Dima helps him.The game has n cities and m bidirectional roads. The cities are numbered from 1 to n. Between any pair of cities there either is a sin

2014-08-09 15:20:49 755

原创 CF 455B-- A Lot of Games

Andrew, Fedor and Alex are inventive guys. Now they invent the game with strings for two players.Given a group of n non-empty strings. During the game two players build the word together, initiall

2014-08-09 15:11:38 885

原创 HDU4915--Parenthese sequence

Problem Descriptionbobo found an ancient string. The string contains only three charaters -- "(", ")" and "?".bobo would like to replace each "?" with "(" or ")" so that the string is valid (def

2014-08-05 19:43:44 557

原创 高斯消元模板

=_=观摩了下神牛的高斯消元模板,可耻地搬过来了

2014-08-05 10:56:46 457

原创 acdream--Matrix sum

Problem Descriptionsweet和zero在玩矩阵游戏,sweet画了一个N * M的矩阵,矩阵的每个格子有一个整数。zero给出N个数Ki,和M个数Kj,zero要求sweet选出一些数,满足从第 i 行至少选出了Ki个数,第j列至少选出了Kj个数。 这些数之和就是sweet要付给zero的糖果数。sweet想知道他至少要给zero多少个糖果,您能帮他做出一个最优策略吗?

2014-08-02 11:08:33 632

原创 HDU4905--The Little Devil II(四边形不等式优化)

Problem DescriptionThere is an old country and the king fell in love with a devil. The devil always asks the king to do some crazy things. Although the king used to be wise and beloved by his peop

2014-07-31 19:55:43 915

原创 HDU2828--Lamp(Dancing Links)

Problem DescriptionThere are several switches and lamps in the room, however, the connections between them are very complicated. One lamp may be controlled by several switches, and one switch may

2014-07-30 19:57:59 635

原创 HDU2295--Radar(Dancing Links)

Problem DescriptionN cities of the Java Kingdom need to be covered by radars for being in a state of war. Since the kingdom has M radar stations but only K operators, we can at most operate K rada

2014-07-30 10:56:13 700

原创 FZU1686--神龙的难题(Dancing Links)

Problem Description这是个剑与魔法的世界.英雄和魔物同在,动荡和安定并存.但总的来说,库尔特王国是个安宁的国家,人民安居乐业,魔物也比较少.但是.总有一些魔物不时会进入城市附近,干扰人民的生活.就要有一些人出来守护居民们不被魔物侵害.魔法使艾米莉就是这样的一个人.她骑着她的坐骑,神龙米格拉一起消灭干扰人类生存的魔物,维护王国的安定.艾米莉希望能够在损伤最小的前提下完成

2014-07-30 10:26:17 772

原创 HDU3663--Power Stations(Dancing Links)

Problem DescriptionThere are N towns in our country, and some of them are connected by electricity cables. It is known that every town owns a power station. When a town’s power station begins to w

2014-07-29 20:32:49 819

Node.js开发指南

Node.js开发指南

2016-01-02

Objective-C基础教程

Objective-C基础教程

2016-01-02

Node.js实战

Node.js实战,Node.js入门,JavaScript,Node socketserver,Node webserver

2016-01-02

空空如也

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

TA关注的人

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