自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

A_Bo的博客

不怕别人比你聪明,就怕别人比你聪明还比你努力

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

原创 c++11中多线程中Join函数

写在前面Join函数作用: Join thread The function returns when the thread execution has completed.//直到线程完成函数才返回 This synchronizes the moment this function returns with the completion of all the ope...

2018-12-31 15:40:35 4174

原创 C++11多线程thread参数传递问题

目录写在前面thread类的构造函数join函数detach函数thread中参数传递类对象作为参数类中函数作为参数参考书籍写在前面多线程在很多地方都是必须要掌握的方法,这里先说一下,thread对象的参数传递问题thread类的构造函数thread() noexcept; //default constructor 其中noexc...

2018-12-31 12:01:51 36924 6

原创 Dijkstra_1072 Gas Station (30 分)

1072 Gas Station (30 分)A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must g...

2018-12-26 21:40:25 374

原创 AVL_insert_1066 Root of AVL Tree (25 分)

1066 Root of AVL Tree (25 分)An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by...

2018-12-20 21:06:36 353

原创 dfs_1064 Complete Binary Search Tree (30 分)

1064 Complete Binary Search Tree (30 分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with key...

2018-12-20 20:04:18 124

原创 c++中的类型转换以及explicit关键字

写在前面在没有深入接触c++之前,只是简单的知道变量存在自动转换和强制转换,比如,int a = 3.3;同样也可以对类对象进行自动类型转换以及强制类型转换类型转换使用《c++ primer plus》中的例子:/*Stonewt.h文件*/#ifndef STONEWT_H_#define STONEWT_H_namespace STONE{ class S...

2018-12-19 22:31:56 442

原创 模拟_1060 Are They Equal (25 分)

1060 Are They Equal (25 分)If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×10​5​​ with simple chopping. No...

2018-12-19 19:43:21 313 1

原创 C++中的命名空间namespace详解及细节参考

名称空间特性c++中要求可以通过定义一种新的声明区域来创建命名空间,这样目的之一就是提供一个声明名称的区域。一个名称区域中的名称不会与另外一个名称空间的相同名称发生冲突,同时允许程序中的其他部分使用该名称访问空间中声明的东西使用namespace建立命名空间的栗子:namespace Jack{ double a; void fetch(); struct ...

2018-12-17 18:17:36 930

原创 dfs_1053 Path of Equal Weight (30 分)

1053 Path of Equal Weight (30 分)Given a non-empty tree with root R, and with weight W​i​​ assigned to each tree node T​i​​. The weight of a path from R to L is defined to be the sum of the weights o...

2018-12-10 22:27:16 192

原创 1049 Counting Ones (30 分)

1049 Counting Ones (30 分)The task is simple: given any positive integer N, you are supposed to count the total number of 1's in the decimal form of the integers from 1 to N. For example, given N bei...

2018-12-10 15:50:13 181

原创 lower_bound_1044 Shopping in Mars (25 分)

1044 Shopping in Mars (25 分)Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the cha...

2018-12-07 19:01:58 193

原创 Manacher_1040 Longest Symmetric String (25 分)

1040 Longest Symmetric String (25 分)Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symmetric?, the longest symmetric sub...

2018-12-07 09:52:18 107

原创 贪心_1033 To Fill or Not to Fill (25 分)

1033 To Fill or Not to Fill (25 分)With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the...

2018-12-06 21:06:56 382

原创 最短路_1018 Public Bike Management (30 分)

1018 Public Bike Management (30 分)There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and ret...

2018-12-04 19:26:52 639

原创 模拟_1014 Waiting in Line (30 分)

1014 Waiting in Line (30 分)Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to...

2018-12-02 14:49:39 291

原创 牛客练习赛32 D Tarjan无向图求桥+并查集维护

题目描述:小p和他的朋友约定好去游乐场游玩,但是他们到了游乐场后却互相找不到对方了。游乐场可以看做是一张n个点,m条道路的图,每条道路有边权wi,表示第一次经过该道路时的花费(第二次及以后经过时花费为0)。现在,小p要去找他的朋友,但他的朋友行踪很诡异,小p总是要遍历完这n个点才能找到他,同时小p希望总花费最小。找到朋友的方案可能不唯一(具体看样例解释),小p想知道在这所有的方案中,有多...

2018-12-02 13:47:13 673

原创 Tarjan算法求割点和割边

目录名词解释Tarjan算法割点求解:割边求解:参考博客名词解释割点:在无向图中,删除某个节点后,图的连通分量数量增加,则称该节点为割点桥:如果删除某条边后,连通图变得不再连通,则此条边为桥,或者为割边Tarjan算法在Tarjan算法中,有两个十分重要的数组,dfn数组,low数组dfn数组:表示dfs遍历到该节点的序号,也就是顺序值low数组:表...

2018-12-01 21:54:49 1971

原创 树形DP_ Xor Path

树形DP,主要思想为:自根节点开始遍历,一直遍历到叶子节点,后从叶子节点开始将得到的信息不断向上传递,知道根节点为止。题目描述:给定一棵n个点的树,每个点有权值。定义表示  到  的最短路径上,所有点的点权异或和。对于,求所有的异或和。输入描述:第一行一个整数n。接下来n-1行,每行2个整数u,v,表示u,v之间有一条边。第n+1行有n个整数,表示每个点的权值。输出...

2018-12-01 11:57:59 202 1

空空如也

空空如也

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

TA关注的人

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