Intersecting Lines Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 13605 Accepted: 6049 Description We all know that a pair of distinct poi ...
分类:
其他好文 时间:
2016-05-19 22:57:52
阅读次数:
164
本篇博文主要介绍散列表(Hash Table)这一常见数据结构的原理与实现。由于个人水平有限,文章中难免存在不准确或是不清晰的地方,希望大家可以指正:) 一、概述 符号表是一种用于存储键值对(key-value pair)的数据结构,我们平常经常使用的数组也可以看做是一个特殊的符号表,数组中的“键” ...
分类:
其他好文 时间:
2016-05-19 15:04:48
阅读次数:
225
A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if there are some tables open when they arrive, they will be assigned to the ava...
分类:
其他好文 时间:
2016-05-18 19:55:29
阅读次数:
235
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #define maxn 150005 #define maxm 100005 #define pi pair ...
分类:
其他好文 时间:
2016-05-17 22:32:11
阅读次数:
193
结对编程(Pair-Programming) 可能是近年来最为流行的编程方式。所谓结对编程,也就是两个人写一个程序,其中,一个人叫Driver,另一个人叫Observer,Driver在编程 代码,而Observer在旁边实时查看Driver的代码,并帮助Driver编程。并且,Driver和Obs ...
分类:
其他好文 时间:
2016-05-13 11:57:37
阅读次数:
133
感觉很简单,就是讨论一下 #include <stdio.h> #include <string.h> #include <algorithm> #include <math.h> using namespace std; typedef pair<double,int>pii; const int ...
分类:
其他好文 时间:
2016-05-13 09:40:28
阅读次数:
130
Time Limit: 2000MS Memory Limit: 10000KDescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common a...
分类:
其他好文 时间:
2016-05-13 01:29:02
阅读次数:
241
1.前言
Hash对象大致有如下方法:
1) clone():复制已有的Hash对象,返回复制产生的新Hash对象。
2) each(iterator):遍历Hash对象里每个key-value对象的迭代器,其中iterator是一个形如function(pair){}的函数,其中pair就是Hash对象的key-value对象。
3) get(k...
分类:
其他好文 时间:
2016-05-13 00:12:32
阅读次数:
236
(define (append a b)
(if (null? a)
b
(cons (car a) (append (cdr a) (cons (car a) b)))))
(define nil (list))
(define (count-leaves x)
(cond ((null? x) 0)
((not (pair? x)) 1)...
分类:
其他好文 时间:
2016-05-12 22:53:59
阅读次数:
265
题意:求多次区间反转后的序列
一眼splay,我用了可持久treap实现的。
速度也不错 2008ms
这么想想splay好像没什么用了(大雾@lct#include
#include
#include
#define N 200005
#define mp make_pair
#define pa pair
using...
分类:
其他好文 时间:
2016-05-12 21:26:59
阅读次数:
144