自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

MissZhou要努力

路漫漫其修远兮,吾将上下而求索

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

原创 nefu487最长递增子序列问题【网络流24题】超详细讲解+模板

description给定正整数序列x1 , ... , xn 。(1)计算其最长递增子序列的长度s。(2)计算从给定的序列中最多可取出多少个长度为s的递增子序列。(3)如果允许在取出的序列中多次使用x1和xn,则从给定序列中最多可取出多少个长度为s的递增子序列。设计有效算法完成(1)(2)(3)提出的计算任务。input

2015-09-26 21:12:22 880

原创 2015亚洲网络赛上海站1010A Sweet Journey

Problem DescriptionMaster Di plans to take his girlfriend for a travel by bike. Their journey, which can be seen as a line segment of length L, is a road of swamps and flats. In the swamp, it take

2015-09-26 15:04:56 565

原创 hdu5249KPI【treap】

Description你工作以后, KPI 就是你的全部了. 我开发了一个服务,取得了很大的知名度。数十亿的请求被推到一个大管道后同时服务从管头拉取请求。让我们来定义每个请求都有一个重要值。我的KPI是由当前管道内请求的重要值的中间值来计算。现在给你服务记录,有时我想知道当前管道内请求的重要值得中间值。 Input有大约100组数据。 每组数据第一行

2015-09-26 10:43:50 367

原创 POJ 1442 Black Box【treap模板】

题意:给一个序列,然后给出m个查询,每次查询输入一个数x,对于第i次查询,输出前x个数中第i大的关键字的值。昨晚上课就像被催眠了一般……orz 晚上套模板还不对T^T 大神给的标程自己的编译器都通过不了是什么鬼还是ACdreamer的模板靠谱#include#include#include#include#include#include#includ

2015-09-26 10:41:12 432

原创 nefu1018数字游戏二【DP】

description有一个长度为n,由数字[0,9]组成的串。我们至多对其进行一次操作,该操作选定一个区间,将区间内的数 改成 s[i] = (10-s[i])%10 (l<=ii<=r);求s[0]+s[1]+……+s[n-1] 的最大值。input输入一个n (1<=n<=1000 000)

2015-09-21 21:37:33 428

原创 nefu1035数位统计

description上次哈工程校赛有一个比较有趣的问题,我们一起来探讨一下!给一个整数10,把10用二进制表示为 1010,那么10的二进制表示中有2个1那么现在的问题是这样的:给一个整数n,然后问小于n的所有数中有多少个数它们的二进制表示中有k个1。 快敲代码,动作! input 多组输入,每组两个整数n,k(

2015-09-21 21:33:50 506

原创 nefu1039基地选址【三分】

description需要在一个N × M的网格中建立一个通讯基站,通讯基站仅必须建立在格点上。网格中有A个用户,每个用户的通讯代价是用户到基站欧几里得距离的平方。网格中还有B个通讯公司,维护基站的代价是基站到最近的一个通讯公司的路程(路程定义为曼哈顿距离)。在网格中建立基站的总代价是用户通讯代价的总和加上维护基站的代价,最小总代价。inpu

2015-09-21 21:28:22 477

原创 nefu1040关于括号的简单模拟题

description给定一个括号字符数组S,S可以用两个整数数组P和W来描述,其中:数组P中的元素Pi定义为:第i个右括号前面有Pi个左括号;数组W中的元素Wi定义为,第i个右括号和其配对的左括号之间所包含的完整的括号的对数。现在给你P数组,让你求出该字符数组S所对应的W数组。比如下面这个例子 S (((()()()))) P

2015-09-21 21:22:57 456

原创 nefu1039超级超级简单的英文题==

descriptionYou, as a member of a development team for a new spell checking program, are to write a module that will check the correctness of given words using a known dictionary of all cor

2015-09-21 21:11:48 575

原创 nefu1037回文子序列数

description给定字符串,求它的回文子序列个数。回文子序列反转字符顺序后仍然与原序列相同。例如字符串aba中,回文子序列为"a", "a", "aa", "b", "aba",共5个。内容相同位置不同的子序列算不同的子序列。input

2015-09-21 21:04:03 535

原创 hdu2795Billboard【线段树】

Problem DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcement

2015-09-21 20:35:50 342

原创 nefu559分书问题【类8皇后】

description有编号分别为1..n的n本书,准备分给n个人,每个人阅读兴趣用一个二维数组加以描述: 1:喜欢这本书0:不喜欢这本书Like[i][j] = 1 i 喜欢书jLike[i][j] = 0 i 不喜欢书j求解如何分书,让所有人都满意。input输入有多组数据,每组数据第一行,包含一个的正整数n.

2015-09-21 20:27:04 447

原创 0-1背包:nefu19采药hdu2546饭卡

这两个题都是大二下刚开学写的基本就是裸的01背包==高度相似现在看来简直简单的不能再简单了 不过话说面试的难度不就到二重背包么╮(╯_╰)╭Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大

2015-09-21 20:12:58 960

原创 nefu494深海机器人问题【网络流24题】最大费用流

description 深海资源考察探险队的潜艇将到达深海的海底进行科学考察。潜艇内有多个深海机器人。潜艇到达深海海底后,深海机器人将离开潜艇向预定目标移动。深海机器人在移动中还必须沿途采集海底生物标本。沿途生物标本由最先遇到它的深海机器人完成采集。每条预定路径上的生物标本的价值是已知的,而且生物标本只能被采集一次。本题限定深海机器人只能从其出发位置沿着向北或向东的方

2015-09-19 10:29:31 983

原创 nefu488餐巾计划问题【网络流24题】最小费用流

description 一个餐厅在相继的N 天里,每天需用的餐巾数不尽相同。假设第i天需要ri块餐巾(i=1,2,…,N)。餐厅可以购买新的餐巾,每块餐巾的费用为p分;或者把旧餐巾送到快洗部,洗一块需m天,其费用为f 分;或者送到慢洗部,洗一块需n 天(n > m),其费用为s < f 分。每天结束时,餐厅必须决定将多少块脏的餐巾送到快洗部,多少块餐巾送到

2015-09-19 08:22:19 1033

原创 hdu1505city game dp

Problem DescriptionBob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees

2015-09-17 09:41:05 613

原创 hdu1506Largest Rectangle in a Histogram

Problem DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the fi

2015-09-16 20:47:13 675

原创 hdu1160FatMouse's Speed DP

Problem DescriptionFatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as p

2015-09-15 21:41:17 437

原创 HDU1159Common Subsequence DP

Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there e

2015-09-14 19:11:05 412

原创 hdu1421搬寝室 DP

Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度

2015-09-14 09:34:05 555

原创 poj2318toys判断点是否在四边形内

DescriptionCalculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is finished playing with th

2015-09-12 21:43:19 388

原创 poj1269Intersecting Lines直线相交 模板

DescriptionWe all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are paralle

2015-09-12 20:43:04 383

转载 几何题目总结——9月省赛惨败的教训

//第一期计算几何题的特点与做题要领:1.大部分不会很难,少部分题目思路很巧妙2.做计算几何题目,模板很重要,模板必须高度可靠。3.要注意代码的组织,因为计算几何的题目很容易上两百行代码,里面大部分是模板。如果代码一片混乱,那么会严重影响做题正确率。4.注意精度控制。5.能用整数的地方尽量用整数,要想到扩大数据的方法(扩大一倍,或扩大sqrt2)。因为整

2015-09-12 18:58:01 449

原创 hdu2176取(m堆)石子游戏 组合游戏初步——NIM

Descriptionm堆石子,两人轮流取.只能在1堆中取.取完者胜.先取者负输出No.先取者胜输出Yes,然后输出怎样取子.例如5堆 5,7,8,9,10先取者胜,先取者第1次取时可以从有8个的那一堆取走7个剩下1个,也可以从有9个的中那一堆取走9个剩下0个,也可以从有10个的中那一堆取走7个剩下3个. Input输入有多组.每组第1行是m,m 

2015-09-12 16:53:03 399

原创 hdu2147kiki's game博弈

DescriptionRecently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the chesserboard is n*m.First of all, a coin is place

2015-09-12 16:42:43 447

原创 HDU1847Good Luck in CET-4 Everybody!递推求解必胜、必败点 附三种经典博弈

Problem Description大学英语四级考试就要来临了,你是不是在紧张的复习?也许紧张得连短学期的ACM都没工夫练习了,反正我知道的Kiki和Cici都是如此。当然,作为在考场浸润了十几载的当代大学生,Kiki和Cici更懂得考前的放松,所谓“张弛有道”就是这个意思。这不,Kiki和Cici在每天晚上休息之前都要玩一会儿扑克牌以放松神经。“升级”?“双扣”?“红五”?还是“斗

2015-09-11 21:15:41 14627

转载 几何点线面模板

#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#i

2015-09-11 20:35:27 593

原创 HDU3065病毒侵袭持续中AC自动机

Description小t非常感谢大家帮忙解决了他的上一个问题。然而病毒侵袭持续中。在小t的不懈努力下,他发现了网路中的“万恶之源”。这是一个庞大的病毒网站,他有着好多好多的病毒,但是这个网站包含的病毒很奇怪,这些病毒的特征码很短,而且只包含“英文大写字符”。当然小t好想好想为民除害,但是小t从来不打没有准备的战争。知己知彼,百战不殆,小t首先要做的是知道这个病毒网站特征:包含多少不同的病

2015-09-11 20:32:35 514

原创 HDU2896病毒侵袭 AC自动机

Description当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋――我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~ 但网路上总有那么些网站,开始借着民众的好奇心,打着介绍日食的旗号,大肆传播病毒。小t不幸成为受害者之一。小t如此生气,他决定要把世界上所有带病毒的网站都找出来。当然,谁都知道这是不可能的。小t

2015-09-11 20:30:27 439

原创 hdu2222Keywords Search AC自动机模板题

DescriptionIn the modern time, Search engine came into the life of everybody like Google, Baidu, etc. Wiskey also wants to bring this feature to his image retrieval system. Every image have a long

2015-09-11 20:26:45 435

原创 poj1113Wall凸包入门题 模板

DescriptionOnce upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castle. The King was so greedy, that he would not listen to his Architect's pr

2015-09-11 20:10:15 350

原创 多校联合第八场hdu5387Clock 最大公约数

Problem DescriptionGive a time.(hh:mm:ss),you should answer the angle between any two of the minute.hour.second handNotice that the answer must be not more 180 and not less than 0 Inpu

2015-09-11 18:54:03 526

原创 2015多校联合第六场hdu5363Key Set 快速幂+yy

Problem Descriptionsoda has a set S with n integers {1,2,…,n}. A set is called key set if the sum of integers in the set is an even number. He wants to know how many nonempty subsets of S are

2015-09-11 07:52:03 452

原创 2015多校联合第四场hdu5327Olympiad 递推

Problem DescriptionYou are one of the competitors of the Olympiad in numbers. The problem of this year relates to beatiful numbers. One integer is called beautiful if and only if all of its digita

2015-09-10 20:48:53 543

转载 JAVA学习路线图---(JAVA1234)

第一阶段-Java基础       这一阶段很重要,关系到你后面阶段的学习,所以务必把这一阶段掌握好;       如果你是0基本,我推荐一本比较好的,适合初学者看的书:明日科技的《Java从入门到精通》,最新版应该是第三版;       这一阶段你要掌握的知识是Java基础,Java面向对象,还有数据库,JDBC,debug断点调试方法,Swing也了解下;

2015-09-10 20:11:51 7350 2

原创 2015多校联合第二场hdu5303Delicious Apples DP 类似最长山峰序列

Problem DescriptionThere are n apple trees planted along a cyclic road, which is L metres long. Your storehouse is built at position 0 on that cyclic road.The ith tree is planted at posi

2015-09-10 16:44:48 543

原创 2015多校联合第十场hdu5407CRB and Candies数论 唯一分解定理

Problem DescriptionCRB has N different candies. He is going to eat K candies.He wonders how many combinations he can select.Can you answer his question for all K(0 ≤ K ≤ N)?CRB is too hu

2015-09-10 07:51:02 638

原创 2015多校联合第八场hdu5389Zero Escape DP

Problem DescriptionZero Escape, is a visual novel adventure video game directed by Kotaro Uchikoshi (you may hear about ever17?) and developed by Chunsoft.Stilwell is enjoying the first chapte

2015-09-09 19:38:16 532

原创 2015多校联合第六场 hdu5373 The shortest problem 水

Problem DescriptionIn this problem, we should solve an interesting game. At first, we have an integer n, then we begin to make some funny change. We sum up every digit of the n, then insert it to

2015-09-08 20:22:38 555

原创 2015多校联合第八场hdu5384Danganronpa AC自动机

Problem DescriptionDanganronpa is a video game franchise created and developed by Spike Chunsoft, the series' name is compounded from the Japanese words for "bullet" (dangan) and "refutation" (ron

2015-09-08 19:24:17 532

空空如也

空空如也

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

TA关注的人

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