自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 数据结构之"逆波兰树"求解算式 [a + b * (c - d) - e / f]

逆波兰树加引号是因为这是我给她起的名字。。莫名喜感。一个算式的”波兰树“的构建并不是唯一的,这个得看个人的选择,选择括号外面的加号或减号作为树根。然后将剩下的算式依次拆分。将算术符号用子二叉树的根节点代替,数值用二叉树的左右子节点代替,这样就得到了一棵所求算式的波兰树,然后将其变化为扩充二叉树,得出她的前序遍历序列。然后通过一个创建波兰树的函数   Get_bolantree();,从而得到一个由

2016-10-28 17:07:49 2087

原创 HDU 1483 Automatic Correction of Misspellings (字符串大模拟)

DescriptionSome text editors offer a feature to correct words which seem to be written incorrectly. In this problem you are asked to implement a simple Automatic Correction of Misspellings (ACM). 

2016-10-23 11:15:13 315

原创 LightOJ 1135 Count the Multiples of 3 (Segmengt + 懒惰标记)

DescriptionYou have an array with n elements which is indexed from 0 to n - 1. Initially all elements are zero. Now you have to deal with two types of operations1.      Increase the numbers betw

2016-10-22 22:07:40 295

原创 LightOJ - 1164 Horrible Queries 线段树+懒惰标记

DescriptionWorld is getting more evil and it's getting tougher to get into the Evil League of Evil. Since the legendary Bad Horse has retired, now you have to correctly answer the evil questions o

2016-10-20 20:40:10 296

原创 CodeForces - 731C Socks (并查集)

C. Sockstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputArseniy is already grown-up and independent. His m

2016-10-18 17:20:20 752

原创 数据结构之拓扑排序

感觉重点就是邻接表的创建和tp(topoSort()函数中的一个变量)的变化很奇妙,相当于是一个静态指针的用法。#include #include #include #include #include #include #include #include #include #define INF 0x3f3f3f3f#define mem(a,b) memset(a

2016-10-09 22:33:53 449

原创 数据结构之最短路径的 Dijkstra Algorithm && Floyd Algorithm

没有什么说的。代码中讲解的应该还算明确。但是我想说的是一定要把最短路径和最小生成树给分开。。最小生成树是求一个Graph(这个图中必定是全部联通图)中,求解所有子树中所有路径之和最小的子树。。而最短路径则求Graph中是从一个点到另一个点路径之和最短的路径。这完全是两个问题。。没有任何联系!#include #include #include #include #inclu

2016-10-08 21:26:21 261

原创 CodeForces 615B Longtail Hedgehog(长尾巴的刺猬) 动态规划

B. Longtail Hedgehogtime limit per test 3 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputThis Christmas Santa gave Masha a

2016-10-07 18:11:06 448

空空如也

空空如也

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

TA关注的人

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