一开始我用分块大法,分成$\sqrt{n}$块,每个块上维护一个Splay,然后balabala维护一下,时间复杂度是$O(n\sqrt{n}logn)$。后来对拍的时候发现比$O(n^2)$的暴力跑得还慢,TA爷说是Splay常数太大2333333 标算是块状链表,什么balabala比较基础地维 ...
分类:
其他好文 时间:
2016-06-18 23:44:40
阅读次数:
252
这个程序介绍了sort()函数个各种用法。
源程序来自:std::sort - cppreference.com。
程序如下:
#include
#include
#include
#include
int main()
{
std::array s = {5, 7, 4, 2, 8, 6, 1, 9, 0, 3};
// sort using the def...
分类:
编程语言 时间:
2016-06-18 13:00:32
阅读次数:
155
Given a sorted array of integers nums and integer values a, b and c. Apply a function of the form f(x) = ax2 + bx + c to each element x in the array. ...
分类:
编程语言 时间:
2016-06-18 07:51:49
阅读次数:
364
// 来自 http://www.runoob.com/jsref/jsref-obj-array.html var arr01 = [ "fuc" , "shit" , "assho" ]; var arr02 = [ 1 , 2 , 3 ]; // 以下多数省略前半部分的对象名(arr01) v ...
分类:
编程语言 时间:
2016-06-18 01:15:13
阅读次数:
119
题目链接: Array Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Problem Description Vicky is a magician who loves math. ...
分类:
其他好文 时间:
2016-06-17 23:47:43
阅读次数:
216
Prototype(http://www.prototypejs.org/) Prototype是最早成型的JavaScript库之一,对JavaScript的内置对象(例如String对象,Array对象等)做了大量扩展.现在还有很多项目使用Prototype.Prototype可以看做是把很多好 ...
分类:
编程语言 时间:
2016-06-17 22:36:35
阅读次数:
306
例一: <?php$input = array("a" => "green","", "red","b" => "green", "","blue", "red","c" => "witer","hello","witer");//$result = array_unique($input); // ...
分类:
编程语言 时间:
2016-06-17 22:23:35
阅读次数:
232
$query = array(); foreach($topPids as $pid) { $query['_id']['$in'][] = new MongoId($pid); } $topPlayerManagers = EuroCupPlayerManager::model()->findAl ...
分类:
Web程序 时间:
2016-06-17 21:13:03
阅读次数:
226
Remove Duplicates from Sorted Array 本题收获: 1.“删除”数组中元素 2.数组输出 题目: Given a sorted array, remove the duplicates in place such that each element appear on ...
分类:
其他好文 时间:
2016-06-17 21:10:58
阅读次数:
208
Given k sorted integer arrays, merge them into one sorted array. Given 3 sorted arrays: return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]. 这题和merge k sort ...
分类:
其他好文 时间:
2016-06-17 21:01:25
阅读次数:
132