自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 树上两点最近公共祖先LCA的倍增算法 poj1986

Distance QueriesTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 14755 Accepted: 5187Case Time Limit: 1000MSDescriptionFarmer John's cows refused to run in his marathon since he chose a path much too long for their leisurely lifestyle. He

2017-09-29 20:13:07 1497

原创 矩形面积并集,2017ICPC网络赛(南宁)Overlapping Rectangles

矩形面积并集There are nn rectangles on the plane. The problem is to find the area of the union of these rectangles. Note that these rectangles might overlap with each other, and the overlapped areas of these rectangles shall not be counted more than once. For

2017-09-25 21:27:53 1067

原创 ICPC2017网络赛(南宁)子序列最大权值(树状数组+dp)

Let SS be a sequence of integers s_{1}s​1​​ , s_{2}s​2​​ , ......, s_{n}s​n​​ Each integer is is associated with a weight by the following rules:(1) If is is negative, then its weight is 00.(2) If is is greater than or equal to 1000010000, then its

2017-09-24 20:13:35 938

原创 ICPC2017网络赛(北京)Minimum(线段树or树状数组区间最值维护)

描述You are given a list of integers a0, a1, …, a2^k-1.You need to support two types of queries:1. Output Minx,y∈[l,r] {ax∙ay}.2. Let ax=y.输入The first line is an integer T, indicating the number of test cases. (1≤T≤10).For each test case:The fi

2017-09-24 11:38:13 542

原创 ICPC2017网络赛(北京)Territorial Dispute(凸包分割)

#1582 : Territorial Dispute时间限制:1000ms单点时限:1000ms内存限制:256MB描述In 2333, the C++ Empire and the Java Republic become the most powerful country in the world. They compete with each other in the colonizing the Mars.There are n colonies on the Mars, numbe

2017-09-23 18:09:49 977

原创 二分匹配 4579: 多米诺骨牌II(中石油)

4579: 多米诺骨牌II时间限制: 1 Sec 内存限制: 128 MB提交: 42 解决: 11[提交][状态][讨论版]题目描述一个矩形可以划分成M*N个小正方形,其中有一些小正方形不能使用。一个多米诺骨牌占用两个相邻的小正方形。试问整个区域内最多可以不重叠地放多少个多米诺骨牌且不占用任何一个被标记为无法使用的小正方形。输入第一行有两个用空格隔开的正整数M和N(M<=50,N<=50)。第二行有一个正整数K,表示共有K个小正方形不能使用。输入数据保证K<=M*N。以下K行每

2017-09-23 11:36:32 640

原创 最小树形图--有向图的最小生成树 poj 3164 Command Network

【最小树形图】:就是给有向带权图中指定一个特殊的点root,求一棵以root为根的有向生成树T,并且T中所有边的总权值最小。最小树形图必须有一个根,而且选择不同的点作为根,也是不一样的结果。最小树形图必须包含图中的每一个节点,并且均可通过有向边到达根节点root最小树形图的第一个算法是 1965年朱永津和刘振宏提出的复杂度为O(VE)的算法。Command NetworkTime Limit: 1000MS Memory Limit: 131072KTotal Submissions:

2017-09-22 17:26:45 2259

原创 次小生成树的学习 POJ1679 The Unique MST

The Unique MSTTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 32145 Accepted: 11631DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected

2017-09-21 22:13:01 590

原创 欧拉图的学习hdu1878(欧拉回路)

欧拉回路Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15658 Accepted Submission(s): 5987Problem Description欧拉回路是指不令笔离开纸面,可画过图中每条边仅一次,且可以回到起点的一条回路。现给定一个图,问是否存在欧拉回路? Input测试输入包含若干测试用例。每个

2017-09-21 12:46:55 640

原创 bzoj 1012 [JSOI2008]最大数maxnumber(ST表最值查询——RMQ算法)

1012: [JSOI2008]最大数maxnumberTime Limit: 3 Sec Memory Limit: 162 MBSubmit: 11110 Solved: 4859[Submit][Status][Discuss]Description  现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一

2017-09-20 20:58:52 821

原创 bzoj1010 [HNOI2008]玩具装箱toy(斜率优化DP)

1010: [HNOI2008]玩具装箱toyTime Limit: 1 Sec Memory Limit: 162 MBSubmit: 11398 Solved: 4806[Submit][Status][Discuss]Description  P教授要去看奥运,但是他舍不下他的玩具,于是他决定把所有的玩具运到北京。他使用自己的压缩器进行压缩,其可以将任意物品变成一堆,再放到一种特殊的一维容器中。P教授有编号为1...N的N件玩具,第i件玩具经过压缩后变成一维长度为Ci.为了方便整

2017-09-20 13:58:18 550

原创 RMQ算法的学习(区间最值问题)NYOJ 119 士兵杀敌(三)

士兵杀敌(三)时间限制:2000 ms | 内存限制:65535 KB难度:5描述南将军统率着N个士兵,士兵分别编号为1~N,南将军经常爱拿某一段编号内杀敌数最高的人与杀敌数最低的人进行比较,计算出两个人的杀敌数差值,用这种方法一方面能鼓舞杀敌数高的人,另一方面也算是批评杀敌数低的人,起到了很好的效果。所以,南将军经常问军师小工第i号士兵到第j号士兵中,杀敌数最高的人与杀敌数最低的人之间军功差值是多少。现在,请你写一个程序,帮小工回答南将军每次的询问吧。注意,南将军可能询问很多次。

2017-09-18 19:32:08 902

转载 高精度大数(负数)

大数运算

2017-09-17 21:27:47 784

原创 ICPC2017网络赛(青岛)1003 HDU 6208 字符串匹配KMP

The Dominator of StringsTime Limit: 3000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 381 Accepted Submission(s): 97Problem DescriptionHere you have a set of strings. A dominator is a string of the set d

2017-09-17 19:13:56 1180

原创 ICPC2017网络赛(西安)B coin (概率计算)

Bob has a not even coin, every time he tosses the coin, the probability that the coin's front face up is \frac{q}{p}(\frac{q}{p} \le \frac{1}{2})​p​​q​​ (​p​​q​​ ≤​2​​1​​ ).The question is, when Bob tosses the coin kk times, what's the probab

2017-09-16 17:21:50 1347

原创 删数问题(n位数,删掉k位,使其最大)

给出一个n位数,要求删掉其中k位数字,使得剩下的数字组成的数尽量大。输入第1行:两个正整数n, k(1 <= k < n <= 500,000)。第2行:一个n位正整数(无前导0)。输出输出一行,一个正整数,表示剩下的数的最大值。样例输入4 21924样例输出94

2017-09-15 22:28:43 5889 2

原创 波利亚polya定理的学习(解决涂色问题)

推荐讲解:http://www.cnblogs.com/jianglangcaijin/archive/2013/11/26/3444574.html【目的】:通过群论知识解决涂色问题,比如方格啊,正方体啊,给m种颜色,问有多少种涂法。需要有一定的群论基础。polya定理利用置换群计算涂色方案。上面推荐的讲解里说了个很好的例子,四个格子的涂色方案。在这里我记录一下今天我推导

2017-09-13 18:51:44 5877 1

原创 差分约束系统的学习 poj1364(bellman和spfa)

KingTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 13843 Accepted: 4920DescriptionOnce, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed: ``If my child was a son and if only he was a sound king.'' Af

2017-09-12 21:52:59 2356 2

原创 AC自动机 HDU2222 Keywords Search

AC自动机Keywords SearchTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 67751 Accepted Submission(s): 22807Problem DescriptionIn the modern time, Search engine came into the life of everybod

2017-09-11 22:18:51 707

原创 HDU3746Cyclic Nacklace(KMP 求循环节)

Cyclic NacklaceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10367 Accepted Submission(s): 4438Problem DescriptionCC always becomes very depressed at the end of this month, he has checked

2017-09-10 20:48:00 938

原创 ICPC2017网络赛(沈阳)1012&HDU6205Card(最大子段和)

card card cardTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 74 Accepted Submission(s): 28Problem DescriptionAs a fan of Doudizhu, WYJ likes collecting playing cards very much. One day, M

2017-09-10 18:50:22 2148

原创 ICPC2017网络赛(沈阳)1008&HDU6201transaction(spfa 费用流)

transaction transaction transactionTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 31 Accepted Submission(s): 15Problem DescriptionKelukin is a businessman. Every day, he travels around c

2017-09-10 18:41:45 1925 4

原创 ICPC2017网络赛(沈阳)1005&HDU6198 number (矩阵+快速幂)

number number numberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 26 Accepted Submission(s): 13Problem DescriptionWe define a sequence F:⋅ F0=0,F1=1;⋅ Fn=Fn−1+Fn−2 (n≥2).Give you an

2017-09-10 18:29:15 1737

原创 ICPC2017网络赛(乌鲁木齐)E: Half-consecutive Numbers (大数)

E: Half-consecutive Numbers time limit 2000ms memory limit 131072KB The numbers 1, 3, 6, 10, 15, 21, 28, 36, 45 and t = i(i +1), are called halfconsecutive. For given N, find the smallest r which is no smaller than N such that t is square. i 2 1 rInpu

2017-09-09 17:32:25 1030

原创 ICPC2017网络赛(乌鲁木齐)H: Skiing (SPFA最长路)

H: Skiing time limit 1000ms memory limit 131072KB i iIn this winter holiday, Bob has a plan for skiing at the mountain resort. This ski resort has M different ski paths and N different flags situated at those turning points. The i-th path from the S -th fla

2017-09-09 17:21:47 1239

原创 bzoj 1024: [SCOI2009]生日快乐(暴力dfs枚举所有情况)

1024: [SCOI2009]生日快乐Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 2890 Solved: 2103[Submit][Status][Discuss]Description  windy的生日到了,为了庆祝生日,他的朋友们帮他买了一个边长分别为 X 和 Y 的矩形蛋糕。现在包括windy,一共有 N 个人来分这块大蛋糕,要求每个人必须获得相同面积的蛋糕。windy主刀,每一切只能平行于一块蛋糕的一边(任意一边),并且必须

2017-09-08 13:40:24 833

原创 bzoj1001 [BeiJing2006]狼抓兔子(网络流dinic算法||最短路spfa)

1001: [BeiJing2006]狼抓兔子Time Limit: 15 Sec Memory Limit: 162 MBSubmit: 24017 Solved: 6068[Submit][Status][Discuss]Description现在小朋友们最喜欢的"喜羊羊与灰太狼",话说灰太狼抓羊不到,但抓兔子还是比较在行的,而且现在的兔子还比较笨,它们只有两个窝,现在你做为狼王,面对下面这样一个网格的地形: 左上角点为(1,1),右下角点为(N,M)(上图中N=4,M=5).有以下

2017-09-08 12:41:54 1020

原创 bzoj 1007: [HNOI2008]水平可见直线(模拟栈)

1007: [HNOI2008]水平可见直线Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 7644 Solved: 2922[Submit][Status][Discuss]Description  在xoy直角坐标平面上有n条直线L1,L2,...Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为可见的,否则Li为被覆盖的.例如,对于直线:L1:y=x; L2:y=-x; L3:y=0则L1和L2是可见的,L3是被覆

2017-09-07 21:36:05 731

原创 51nod 1091 线段的重叠 (贪心)

1091 线段的重叠基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题X轴上有N条线段,每条线段包括1个起点和终点。线段的重叠是这样来算的,[10 20]和[12 25]的重叠部分为[12 20]。给出N条线段的起点和终点,从中选出2条线段,这两条线段的重叠部分是最长的。输出这个最长的距离。如果没有重叠,输出0。Input第1行:线段的数量N(2 <= N <= 50000)。第2 - N + 1行:每行2个数,线段的起点和终点。(0 <= s , e <= 10^

2017-09-05 21:37:16 766

原创 bzoj 1003 [ZJOI2006]物流运输(最短路spfa+dp)

1003: [ZJOI2006]物流运输Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 8303 Solved: 3489[Submit][Status][Discuss]Description  物流公司要把一批货物从码头A运到码头B。由于货物量比较大,需要n天才能运完。货物运输过程中一般要转停好几个码头。物流公司通常会设计一条固定的运输路线,以便对整个运输过程实施严格的管理和跟踪。由于各种因素的存在,有的时候某个码头会无法装卸货物。这时

2017-09-05 19:12:10 1007

原创 RMRC2016问题 B: Election(概率计算)

问题 B: Election时间限制: 1 Sec 内存限制: 128 MB提交: 83 解决: 12[提交][状态][讨论版]题目描述After all the fundraising, campaigning and debating, the election day has finally arrived. Only two candidates remain on the ballot and you work as an aide to one of them.Reports

2017-09-03 17:17:57 1356

原创 中石油4215: Water(dinic网络流,深度优化)

4215: Water时间限制: 1 Sec 内存限制: 128 MB提交: 49 解决: 12[提交][状态][讨论版]题目描述A water company is trying to provide water from its pumping station to a mansion. The company owns n water stations, numbered 1..n, which are connected by a variety of pipes. Water ca

2017-09-02 20:19:40 872

原创 SER2016 DIV1 问题 H: Paint(区间问题贪心+dp优化)

问题 H: Paint时间限制: 1 Sec 内存限制:128 MB提交: 38 解决: 9[提交][状态][讨论版]题目描述You are painting a picket fence with n slats, numbered from 1 to n. There are k painters willing to paint a specific portion of the fence. However, they don’t like each other, and each

2017-09-02 18:18:01 1162

原创 (关系幂运算->n长度的最短路)河南省第十届ACM省赛题目:问题 I: Transmit information

问题 I: Transmit information时间限制: 3 Sec 内存限制: 128 MB提交: 2 解决: 2[提交][状态][讨论版]点击打开题目链接题目描述 The Chinese people threw themselves into an all-out war of resistance against Japanese aggression in 1937. The first line of resistance against aggression was

2017-09-01 19:19:27 924

空空如也

空空如也

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

TA关注的人

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