自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

kongming_acm的专栏

如果不能正常显示代码 ,请右键->查看源文件 来查看源代码 里面有代码部分 另外由于网站原因 \n在博客里都显示是/n 请自己更改

  • 博客(30)
  • 资源 (7)
  • 收藏
  • 关注

原创 joj 3760 JLUCPC 树状DP

#include#include#include#includeusing namespace std;const int maxn=210000;struct Node{    int t,w;    int next;};int p[maxn];Node G[maxn];in

2011-07-29 14:12:28 465

原创 hdu 3893 Drawing Pictures 求一串字符中不包含某些字串的个数 AC自动机+矩阵乘法

Problem DescriptionDr. Skywind is drawing a picture, using his favorite six colors, namely red, orange, yellow, green, blue, and violet.The

2011-07-29 13:44:50 568

原创 hdu 3874 Necklace 求数组任意区间和(相同元素只算一次) 树状数组+离线算法

Problem DescriptionMery has a beautiful necklace. The necklace is made up of N magic balls. Each ball has a beautiful value. The balls with

2011-07-28 17:04:54 634

原创 hdu 3868 The Triangle ransmitter 给N个平面上的点,找三个点,使两两距离之和最小,可以不是三角形

Problem DescriptionThe Kingdom of Silence is a beautiful country. There are N cities in the kingdom. There are several highways so that peop

2011-07-28 16:11:44 1006

原创 hdu 3866 Moonfang's Birthday

Problem DescriptionIt's Moonfang's birthday,and his friends decided to buy him a copy of XianJianQiXiaZhuan V.  Since some of friends have m

2011-07-28 15:33:17 611

原创 bupt 204 Palindrome 求字符串任意区间的最长回文子串 二分答案+后缀数组

Description Given a string S,you are asked to find the longest palindrome in the substring [l,r].Input The first line is

2011-07-28 14:57:47 599

原创 hdu 3887 Counting Offspring 树上求所有节点的子树上比当前节点小的个数 树状数组

Problem DescriptionYou are given a tree, it’s root is p, and the node is numbered from 1 to n. Now define f(i) as the number of nodes whose

2011-07-26 16:54:32 586

转载 hdu 3854 Glorious Array

Problem DescriptionYou are given a array with N nodes. The array nodes are numbered from 1 to N ( represented by a_i ). In the start, the co

2011-07-26 10:26:11 525

原创 hdu 3853 LOOPS

he planform of the LOOPS is a rectangle of R*C grids. There is a portal in each grid except the exit grid. It costs Homura 2 magic power to

2011-07-26 09:29:53 512

原创 zoj 3511 Cake Robbery 给一个N个点的环(就当它是个正多边形好了),每次沿着两个点切下去一刀,一共切M刀,刀与刀之间不会交叉,问切完以后边长最多的多边形的边长是多少

As usual, Alice finishes her delicious cake at noon. Unfortunately, the smell of cake beckoned hungry Bob, and he decided to rob one piece o

2011-07-25 17:06:26 959

原创 zoj 3512 Financial Fraud 给定一个整数序列a1, a2, … , an,求一个不下降序列b1 ≤ b2 ≤ … ≤ bn,使得数列{ai}和{bi}的各项之差的绝对值之和 |

In every quarter of these years, the two programmers would receive a data sheet, which provided a series of profit records a1 a2 ... aN in t

2011-07-25 14:58:33 2687 2

原创 poj 3691 DNA repair 最少修改几处,使S不含任何模板DNA(可重叠)

DescriptionBiologists finally invent techniques of repairing DNA that contains segments causing kinds of inherited diseases. For the sake of

2011-07-25 11:25:10 724

原创 hdu 2243 长度为1~N的串中包含了模式串的串总共有几个

Problem Description背单词,始终是复习英语的重要环节。在荒废了3年大学生涯后,Lele也终于要开始背单词了。一天,Lele在某本单词书上看到了一个根据词根来背单词的方法。比如"ab",放在单词前一般表示"相反,变坏,离去"等。于是Lele想,如果背了N个词根,那

2011-07-25 09:12:15 893

原创 hdu 2851 Beat It 单调队列+DP

Problem DescriptionThere's a monster-attacking game on the Renren's open platform, and the game's background are showing below.Where lies a

2011-07-23 21:16:09 713

原创 hdu 3474 Necklace 单调队列 DP

Problem DescriptionYou are given a necklace consists of N beads linked as a circle. Each bead is either crystal or jade.Now, your task is:1.

2011-07-23 19:55:56 710

原创 uestc 1558 Charitable Exchange 最少时间将价值交换到M以上 DP+线段树

DescriptionHave you ever heard a star charity show called Charitable Exchange? In this show, a famous star starts with a small item which va

2011-07-23 16:53:18 703 1

原创 zoj 3228 Searching the String 母串共包含多少子串(重叠和不重叠)

Little jay really hates to deal with string. But moondy likes it very much, and she's so mischievous that she often gives jay some dull prob

2011-07-22 17:27:04 686

原创 zoj 1540 Censored! AC自动机+DP 长度为len的字符串不包含病毒串的个数

The alphabet of Freeland consists of exactly N letters. Each sentence of Freeland language (also known as Freish) consists of exactly M lett

2011-07-22 15:38:44 532

原创 poj 2778 DNA Sequence AC自动机+DP+矩阵乘法 检测所有可能的n位DNA串有多少个DNA串中不含有指定的病毒片段

It's well known that DNA Sequence is a sequence only contains A, C, T and G, and it's very useful to analyze a segment of DNA Sequence,For e

2011-07-21 11:36:54 621

原创 joj 2607: Last time see you again 求1->n路上的必经之地(点)

大学的时光是值得怀念的,有多少事情珍藏在我们的记忆里,又有多少人我们一辈子都忘不掉。 123abc是一个不起眼的小男孩,他曾经在很多方面努力过,也经历了很多失败,在这些努力和失败中,他收获了自己的人生。 whx是123abc认识的一个女生,123abc很喜欢她,总是用各种方法想见

2011-07-18 13:57:48 892

原创 2528 Mayor's posters 线段树的覆盖问题 判断一段区间是否被覆盖

Mayor's postersTime Limit: 1000MS  Memory Limit: 65536KTotal Submissions: 13937  Accepted: 3875DescriptionThe citizens of Bytetown, AB, coul

2011-07-18 10:53:15 368

原创 joj 2737 狼与羊的故事 求任意两点之间的必经之路

村长要召开羊族大会,讨论羊族未来的发展,要求羊羊们到指定地点集合。小羊们收到通知后从家里出发到达指定地点。每个羊的家都是与其他羊的家连通的,可以互相访问。 比如说可以从1到3,同样也可以从3到1 。灰太郎听到这个消息后,准备有所行动(你懂的)。但他不知道应该在哪条路上等羊。但他知

2011-07-14 15:18:56 875

原创 poj 3694 Network 求加边后还剩多少桥

http://poj.org/problem?id=3694A network administrator manages a large network. The network consists of N computers and M links between pairs

2011-07-08 18:01:41 692

原创 poj 1470 Closest Common Ancestors 离线算法Tarjan求LCA

DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the

2011-07-08 17:53:45 511 1

原创 poj 1330 Nearest Common Ancestors 朴素LCA算法

Nearest Common AncestorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9213 Accepted: 4883DescriptionA rooted tree is a well-know

2011-07-08 16:31:50 731

原创 poj 3713 Transferring Sylla 判断无向图是否每两个点之间都能至少有3点不同的路径可达 是否3-连通

After recapturing Sylla, the Company plans to establish a new secure system, a transferring net! The new system is designed as follows:The C

2011-07-08 14:48:03 1998

原创 poj 3177 Redundant Paths 加入最少的边,使得无向图为一个双连通分支 有重边

In order to get from one of the F (1 Given a description of the current set of R (F-1 There might already be more than one paths between the

2011-07-08 11:12:49 533

原创 poj 3352 Road Construction 加入最少的边,使得无向图为一个双连通分支 没有重边

It's almost summer time, and that means that it's almost summer construction time! This year, the good people who are in charge of the roads

2011-07-08 11:01:46 859

原创 poj 2117 Electricity 求无向图中去掉一个点后最大的联通分支数 无向图有可能不联通 tarjan求割点模板

Blackouts and Dark Nights (also known as ACM++) is a company that provides electricity. The company owns several power plants, each of them

2011-07-07 11:42:06 1135

原创 poj 1716 Integer Intervals 差分约束

Integer IntervalsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9285 Accepted: 3898DescriptionAn integer interval [a,

2011-07-06 11:18:23 445

自己的ACM题库和模板

自己的ACM题库和模板

2012-02-04

java聊天室

java聊天室

2011-12-29

dancing links

DLX dancinglinks 跳舞链

2011-12-29

acm动态规划总结

Pku acm 1163 the Triangle 动态规划题目总结(一) 题目:http://acm.pku.edu.cn/JudgeOnline/problem?id=1163 对于一个有数字组成的二叉树,求由叶子到根的一条路径,使数字和最大,如: 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 这个是经典的动态规划,也是最最基础、最最简单的动态规划,典型的多段图。思路就是建立一个数组,由下向上动态规划,保存页子节点到当前节点的最大值,Java核心代码如下: for(int i=num-2;i>

2011-12-29

拓展 KMP edtend MP

给定一个串S,定义n=|S|,extend[i]表示S与S[i…n]的最长公共前缀长度。我们可以在线性时间内得到所有的extend[i]。 鉴于已有论文对这个算法进行细致、感性的描述,在此就不花费篇幅赘述这一算法。如果您想详细了解这一算法,可以参见《寻找最大重复子串》(作者林希德)和《求最长回文子串与最长重复子串》(作者何林)。

2011-04-14

joj 部分题目答案 自己做的 仅供参考

joj 部分题目答案 自己做的 仅供参考 joj 部分题目答案 自己做的 仅供参考 joj 部分题目答案 自己做的 仅供参考 joj 部分题目答案 自己做的 仅供参考 joj 部分题目答案 自己做的 仅供参考

2010-07-10

递推求解 集合了递推的一些题目

在一个平面上有一个圆和n条直线,这些直线中每一条在圆内同其他直线相交,假设没有3条直线相交于一点,试问这些直线将圆分成多少区域。

2010-07-10

空空如也

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

TA关注的人

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