#include
#include
#include using namespace std;const int MAX_N = 100000;int N,S[MAX_N],T[MAX_N];pair itv[MAX_N];void solve()
{
for(int i=0;i<N;i++)
{...
分类:
其他好文 时间:
2015-05-19 16:45:15
阅读次数:
119
#include #include
#include
#include
#include
#include
#define
mp make_pair#define
pa pair#define
M 500005#include
#define
inf 0x3f3f3f3f#define
fi first#define
se secondusing n...
分类:
其他好文 时间:
2015-05-19 00:50:04
阅读次数:
131
一:题目简介 这个java项目是一款打字游戏,运行后点击开始会从屏幕上方掉落数字或字母,且数字及字母为无顺序随机掉落,玩家可以在看到字母或数字后在键盘上输入相应字母或数字将其消除,消除相应个数的字母或数字后,玩家将进入下一关,即加速状态;若在规定时间内没有消除相应字母或数字,则游戏失败。 ...
分类:
其他好文 时间:
2015-05-17 18:26:31
阅读次数:
99
题意
A array contain N number, can you tell me how many different pair i,j that satisfy a[i] + a[j] = M and 1
0
思路:
用map记录会超时
所以想到手写二分。思考一下其实满足题目条件的对数和每个数字的位置并没有关系——排序+二分查找(范围来确定个数)即可。
code:
...
分类:
其他好文 时间:
2015-05-16 16:35:53
阅读次数:
98
Problem Description
ZLGG found a magic theory that the bigger banana the bigger banana peel .This important theory can help him make a portal in our universal. Unfortunately, making a pair of porta...
分类:
其他好文 时间:
2015-05-13 22:06:01
阅读次数:
153
In China, people use a pair of chopsticks to get food on the table, but Mr. L is a bit different. He uses
a set of three chopsticks – one pair, plus an EXTRA long chopstick to get some big food by pi...
分类:
其他好文 时间:
2015-05-12 23:00:48
阅读次数:
271
MapReduce 是一个计算模型,也是一个处理和生成超大数据集的算法模型的相关实现。用户首先创建一个Map函数处理一个基于Key/Value pair 的数据集合,输出中间的基于Key/Value pair的数据集合,然后再创建一个Reduce 函数用来合并所有的具有相同中间Key值的中间Valu...
分类:
其他好文 时间:
2015-05-06 12:23:35
阅读次数:
145
Hadoop 中的MapReduce库支持几种不同格式的输入数据。例如,文本模式的输入数据的每一行被视为一个key/value pair,其中key为文件的偏移量,value为那一行的内容。每一种输入类型的实现都必须能够把输入数据分割成数据片段,并能够由单独的Map任务来对数据片段进行后续处理。一....
分类:
其他好文 时间:
2015-05-05 23:24:26
阅读次数:
197
Map
map迭代器
迭代器失效
map初始化
map插入元素Mapmap的特性是,所有键值会自动被排序。所有元素都是pair类型,同时拥有实体值(value)和键值(key)。pair的第一个元素被看做为键值,第二个看作为实值。同set,map不允许两个元素有相同的键值。又因为键值的自动排列特性,所以在键类型上必须有定义的严格弱排序。所谓的严格弱排序可以理解为在键值类型上的小于关系。所以假如不存在...
分类:
编程语言 时间:
2015-05-05 16:31:59
阅读次数:
151
Caffe1——Mnist数据集创建lmdb或leveldb类型的数据Leveldb和lmdb简单介绍Caffe生成的数据分为2种格式:Lmdb和Leveldb。它们都是键/值对(Key/Value Pair)嵌入式数据库管理系统编程库。虽然lmdb的内存消耗是leveldb的1.1倍,但是lmdb...
分类:
数据库 时间:
2015-05-05 16:23:06
阅读次数:
248