map是键-值对的集合,可以理解为关联数组,可以使用键作为下标来获取一个值
本文地址:http://www.cnblogs.com/archimedes/p/cpp-map.html,转载请注明源地址。
map对象的定义
使用前添加map头文件,必须分别指明键和值的类型:
mapstring,int>word_count;
map的构造函数:
mapm; ...
分类:
编程语言 时间:
2014-05-12 14:57:49
阅读次数:
479
1、list.append(obj) 向列表中添加一个对象obj
list = ['apple', 'pear', 'orange']
>>> list.append('apple')
>>> list
['apple', 'pear', 'orange', 'apple']
2、list.count(obj) 返回一个...
分类:
编程语言 时间:
2014-05-12 14:17:41
阅读次数:
418
查找所有重复标题的记录:SELECT *FROM t_info aWHERE ((SELECT
COUNT(*)FROM t_infoWHERE Title = a.Title) > 1)ORDER BY Title
DESC一。查找重复记录1。查找全部重复记录Select * From 表 Whe...
分类:
数据库 时间:
2014-05-12 13:12:01
阅读次数:
384
How Many Sets IITime Limit:2 Seconds Memory
Limit:65536 KBGiven a setS= {1, 2, ...,n}, numbermandp, your job is to count how
many setTsatisfies the fo...
分类:
其他好文 时间:
2014-05-12 13:05:52
阅读次数:
238
Given a string S and a string T, count the
number of distinct subsequences of T in S.A subsequence of a string is a new
string which is formed from th...
分类:
其他好文 时间:
2014-05-12 09:37:51
阅读次数:
287
查询博客中相同文章类别总共有多少文章
T_Content 博客表
T_ContentType 博客类别表
string sql = "select (select count(*) from T_Content where FTypeId=T.FID) as num from T_ContentType AS T"...
分类:
其他好文 时间:
2014-05-12 07:00:52
阅读次数:
294
#include
#include
int main()
{
int n,m,left,right;
int count;
int deep_n,deep_m,deep_diff;
int i, j;
for( scanf("%d%d",&m,&n); n!=0 && m!=0; scanf("%d%d",...
分类:
其他好文 时间:
2014-05-11 06:38:40
阅读次数:
395
问题提出:服务器100万人在线,16G内存快被吃光。玩家进程占用内存偏高
解决方法:
第一步:
erlang:system_info(process_count). 查看进程数目是否正常,是否超过了erlang虚拟机的最大进程数。
第二步:
查看节点的内存瓶颈所在地方
> erlang:memory().
[{total,2099813400},
{processes,19...
分类:
其他好文 时间:
2014-05-11 01:44:40
阅读次数:
453
Given a stringSand a stringT, count the number
of distinct subsequences ofTinS.A subsequence of a string is a new string which
is formed from the orig...
分类:
其他好文 时间:
2014-05-10 19:10:58
阅读次数:
389
思路:先把1~10000数经过多少次变换的1存入count[MAX_N]数组中,比如count[1]=1就表示1经过一次变换,count[2]=2就表示2经过了2次变换,count[i]=k表示i经过了k次变换。因为输入时m,n谁大谁小不定,所以可以先得到m,n的最大,最小数,然后在求[min(m,...
分类:
其他好文 时间:
2014-05-10 18:41:12
阅读次数:
307