附William Pugh的论文 "《Skip Lists: A Probabilistic Alternative to Balanced Trees》" 写在前面 以下内容针对的是Skip List的插入和删除,建议你先到其他地方大概了解一下Skip List长什么样子的,然后再过来看看这篇,最 ...
分类:
其他好文 时间:
2018-01-19 23:21:10
阅读次数:
203
[BZOJ 3048][Luogu P3069][USACO2013 Jan]Cow Lineup <题意概括> 给定$n\left(n\leqslant100000\right)$个数,求删掉k种相同的数之后最长的相同数区间长度 <做法> 典型的双指针题目 由于数据范围较大,我们将数据离散化 使用 ...
分类:
其他好文 时间:
2018-01-12 11:32:57
阅读次数:
139
对A1135这题有心里阴影了,今天终于拿下AC。学习自柳神博客:https://www.liuchuo.net/archives/4099 首先读题很关键: There is a kind of balanced binary search tree named red-black tree in ...
分类:
其他好文 时间:
2017-12-29 23:40:36
阅读次数:
345
题意: 求出所给范围内满足其数位上的奇数出现偶数次,数位上的偶数出现奇数次(或不出现)的数的个数。 思路: 对于0 ~ 9 每个数有3种情况。 1.没出现过 2.出现奇数次 3.出现偶数次 那么就可以用三进制来表示状态。 #include <iostream> #include <cstring> ...
分类:
其他好文 时间:
2017-12-26 21:54:22
阅读次数:
123
3048: [Usaco2013 Jan]Cow Lineup Description Farmer John's N cows (1 <= N <= 100,000) are lined up in a row. Each cow is identified by an integer "bree ...
分类:
其他好文 时间:
2017-12-25 23:23:31
阅读次数:
227
108. Convert Sorted Array to Binary Search Tree Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For ...
分类:
编程语言 时间:
2017-12-24 22:56:00
阅读次数:
231
[Usaco2007 Mar]Gold Balanced Lineup 平衡的队列 Description Farmer John's N cows (1 <= N <= 100,000) share many similarities. In fact, FJ has been able to n ...
分类:
其他好文 时间:
2017-12-19 19:54:10
阅读次数:
253
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept ...
分类:
其他好文 时间:
2017-12-18 12:09:53
阅读次数:
132
Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 1640 Solved: 1041 Description 每天,农夫 John 的N(1 <= N <= 50,000)头牛总是按同一序列排队. 有一天, John 决定让一些牛们玩一场飞盘比赛. 他准备找一 ...
分类:
其他好文 时间:
2017-12-16 12:53:04
阅读次数:
106
Given a tree string expression in balanced parenthesis format:[A[B[C][D]][E][F]].Construct a tree and return the root of the tree. A / | \ B E F / \ C ...
分类:
其他好文 时间:
2017-12-03 11:44:00
阅读次数:
175