JavaScript 里面本身没有map对象,用JavaScript的Array来实现Map的数据结构。Js代码/**MAP对象,实现MAP功能**接口:*size()获取MAP元素个数*isEmpty()判断MAP是否为空*clear()删除MAP所有元素*put(key,value)向MAP中增...
分类:
编程语言 时间:
2014-07-09 20:44:38
阅读次数:
213
1. [代码]js代码 /** MAP对象,实现MAP功能** 接口:* size() 获取MAP元素个数* isEmpty() 判断MAP是否为空* clear() 删除MAP所有元素* put(key, value) 向MAP中增加元素(key, value)* remove(ke...
分类:
编程语言 时间:
2014-07-09 00:27:03
阅读次数:
300
http://poj.org/problem?id=2513
最初看到 第一感觉---map 一看250000的数据量 果断放弃
然后记得以前看过,trie代替map,尤其当数据量特别大的时候
学到了:
1、Trie代替map的思想,可以在单词结尾的tree[i][tk] 这个i作为字符串对应的int值 ,当然这个int值也可以用于建立并查集
2、接上,通过并查集判断,所有的点在同一...
分类:
移动开发 时间:
2014-07-08 19:09:11
阅读次数:
204
欧拉通路+并查集+字典树
题意是说 木棍两头有颜色,怎么排让它连成一串。颜色相同可以接起来。
最开始想用map水过去,一直TLE。怒点字典树天赋……花了一上午。
字典树不多介绍,我的节点开小了,CE好几次,才想起
“There is no more than 250000 sticks.”
“A word is a sequence of lowercas...
分类:
其他好文 时间:
2014-07-08 17:22:26
阅读次数:
180
If you are not satisfied with default Google map Marker (Default google marker can only be a icon, image or shape),
for example adding a border, then you should use richmarker!
http://google-maps...
分类:
其他好文 时间:
2014-07-08 17:17:18
阅读次数:
386
DECLARE_MESSAGE_MAP(
)
说明:
你的程序中的每一个CCmdTarget的派生类都可以提供一个消息映射以处理消息。在你的类声明的末尾使用DECLARE_MESSAGE_MAP宏。然后,在实现了类成员函数的.CPP文件中加入BEGIN_MESSAGE_MAP宏,再加入每个消息处理函数的宏入口,最后使用END_MESSAGE_MAP宏。
注意:
如果你在DE...
分类:
其他好文 时间:
2014-07-08 16:03:43
阅读次数:
146
字典树
看题库上说这是字典树,不过被我水过去了。
题意是说用对应的字典,翻译出火星文。
each line will contain at most 3000 characters.
看到这句话我就安心了。Time Limit: 10000/5000 MS (Java/Others)
果断用map 来水了。还真AC了。3296MS 。本来是想巩固一下字典树的,不过……。
...
分类:
其他好文 时间:
2014-07-08 14:42:44
阅读次数:
173
字典树问题。
其实也可以用map水过去。但是想到我还要巩固……
唉,还是老老实实用字典树。不过 输入中间的 空行 卡了我一下,RE……
果断判断*str AC了。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#d...
分类:
其他好文 时间:
2014-07-08 14:14:00
阅读次数:
203
今天在Ubuntu下写一个程序的时候用到了hash_set容器,出现一点问题,在这里记录一下,先说一下,hash_*系列例如hash_map,hash_set 等已经被废弃了,C++11用unordered_map,unordered_set等来替代,但是我用的g++ 4.6.1警告说C++11特性是实验性的,貌似到4.8才完全支持。所以就改用hash_set了,写了如下的程序:
#includ...
分类:
其他好文 时间:
2014-07-06 12:47:24
阅读次数:
209
题目如下:
Bicoloring
In 1976 the ``Four Color Map Theorem" was proven with the assistance of acomputer. This theorem states that every map can be colored using only fourcolors, in...
分类:
其他好文 时间:
2014-07-06 12:28:07
阅读次数:
241