自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

算法本子

愿功不唐捐

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

原创 哈希算法在模式匹配问题中的应用

哈希: 哈希算法将任意长度的二进制值映射为较短的固定长度的二进制值,这个小的二进制值称为哈希值。哈希值是一段数据唯一且极其紧凑的数值表示形式。如果散列一段明文而且哪怕只更改该段落的一个字母,随后的哈希都将产生不同的值。要找到散列为同一个值的两个不同的输入,在计算上是不可能的,所以数据的哈希值可以检验数据的完整性。一般用于快速查找和加密算法。 模式匹配: 模式匹配是数据结

2017-03-27 23:10:03 1776

原创 #Codeforces 381 [div2] D. Alyona and a tree 【树链剖分 + 优先队列】

题目:D. Alyona and a treetime limit per test  2 secondsmemory limit per test  256 megabytesinput  standard inputoutput  standard outputAlyona has atree with n vertices. The root of the tree

2016-11-24 11:20:28 1253

原创 2016多校联合第二场 HDU5735 B. Born Slippy 【树状dp剪枝优化】

2016多校联合第二场 HDU5735 B. Born SlippyProblem DescriptionProfessor Zhang has a rooted tree, whose vertices are conveniently labeled by 1,2,...,n. And the i-th vertex is assigned with weight wi.For each s∈{1,2,...,n}, Professor Zhang wants find a sequence o

2016-07-22 15:02:31 1448

原创 #Codeforces 343 [div2] D. Babaei and Birthday Cake 【线段树优先队列查询优化】

题目:D. Babaei and Birthday Caketime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs you know, every bir

2016-04-28 12:02:27 1246

原创 #HDU 1698 Just a Hook 【线段树板题】

题目:Just a HookTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25872    Accepted Submission(s): 12918Problem DescriptionIn

2016-04-28 11:48:07 1024

原创 #HDU 1166 敌兵布阵 【线段树板题】

题目:敌兵布阵Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 70464    Accepted Submission(s): 29532Problem DescriptionC国的死对头A国这段

2016-04-28 11:45:54 1067

原创 #HDU 4747 Mex 【通过区间处理next变化统计总值】

题目:MexTime Limit: 15000/5000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 2517    Accepted Submission(s): 816Problem DescriptionMex is a func

2016-04-28 11:33:55 1702

原创 #POJ 3468 A Simple Problem with Integers 【区间加减法】【水】

题目:A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 88582 Accepted: 27535Case Time Limit: 2000MSDescriptionYou

2016-04-28 11:08:24 1095

原创 #HDU 4325 Flowers 【离散化、区间加减法】

题目:FlowersTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2866    Accepted Submission(s): 1404Problem DescriptionAs is kno

2016-04-28 11:01:35 1157

原创 #POJ 3277 City Horizon 【离散化、区间更新】

题目:City HorizonTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 17855 Accepted: 4896DescriptionFarmer John has taken his cows on a trip to the city

2016-04-27 23:49:11 1201

原创 #POJ 3667 Hotel 【多重线段树、内存分配问题】

题目:HotelTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 15276 Accepted: 6609DescriptionThe cows are journeying north to Thunder Bay in Canada to g

2016-04-27 23:40:40 1224

原创 #POJ 1195 Mobile phones 【二维树状数组】

题目:Mobile phonesTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 17385 Accepted: 8028DescriptionSuppose that the fourth generation mobile phone bas

2016-03-02 12:02:35 1169

原创 #HDU 3371 Connect the Cities 【并查集、染色】

题目:Connect the CitiesTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15440    Accepted Submission(s): 4085Problem Description

2016-03-02 11:54:48 1101

原创 #HDU 2680 Choose the best route 【SPFA最短路】

题目:Choose the best routeTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11846    Accepted Submission(s): 3846Problem Descripti

2016-03-02 11:47:16 1059

原创 #HDU 1233 还是畅通工程 【Prim算法】

题目:还是畅通工程Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 35937    Accepted Submission(s): 16210Problem Description某省调查乡村交通

2016-03-02 11:41:38 1126

原创 #HDU 2647 Reward 【拓扑排序】

题目:RewardTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6614    Accepted Submission(s): 2037Problem DescriptionDandelion'

2016-03-02 11:33:48 1150

原创 #POJ 1182 食物链 【经典并查集】

题目:食物链Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 57770 Accepted: 16890Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-

2016-02-23 09:10:18 2494

原创 #HDU 3790 最短路径问题 【Dijkstra入门题】

题目:最短路径问题Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 19767    Accepted Submission(s): 5880Problem Description给你n个点,m条无

2016-02-23 01:10:13 2937

原创 #HDU 1874 畅通工程续 【Dijkstra最短路】

题目:畅通工程续Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 40043    Accepted Submission(s): 14817Problem Description某省自从实行了很多

2016-02-23 01:01:29 3028

原创 #HDU 1312 Red and Black 【DFS入门】

题目:Red and BlackTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15201    Accepted Submission(s): 9409Problem DescriptionTh

2016-02-23 00:56:28 2631

原创 #HDU 1016 Prime Ring Problem 【DFS+溯回求组数】

A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note: the number of first circle should always be 1.

2016-02-23 00:37:55 3033

原创 #HDU 1372 Knight Moves 【BFS】

题目:Knight MovesTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9206    Accepted Submission(s): 5422Problem DescriptionA fr

2016-02-23 00:32:20 2745

原创 #HDU 1548 A strange lift 【BFS】

题目:A strange liftTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17969    Accepted Submission(s): 6707Problem DescriptionT

2016-02-23 00:26:19 2772

原创 Dijkstra和Prim算法 【含数学证明】

#ACM&算法不知是不是因为自己的抽象学习能力还是不够强,之前在翻阅别人博客学习这两个算法的时候,整个人一直处于懵逼状态。分析了一下,发现之前存在的博客教程,大多趋向于方法讲解,学完以后有知其然不知其所以然的感觉。另一部分博客则偏向数学证明,语言严谨但理解起来确实要费一番功夫。所以打算尝试一下在下文里以解决一个问题的方式讲解这两个算法。在敲算法之前先阐明一下这两个算法所

2016-02-17 20:10:29 8022 2

原创 #AIM Tech Round [div2] C. Graph and String 【连通图、染色】

题目:C. Graph and Stringtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day student Vasya was sitt

2016-02-06 20:53:32 6454 1

原创 #Codeforces 323 [div2] D. Once Again 【优化dp】

Once AgainPROBLEMYou are given an array of positive integers a1, a2, ..., an × T of length n × T. We know that for any i > n it is true that ai = ai - n. Find the length of the longest n

2015-10-30 08:46:53 6741

空空如也

空空如也

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

TA关注的人

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