码迷,mamicode.com
首页 >  
搜索关键字:pair    ( 2800个结果
A+B 吐槽
A+B Description Calculate a + b Input The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line. Output For each pair of input integers a ...
分类:其他好文   时间:2015-06-02 09:24:12    阅读次数:99
srm 530
srm 529感觉题并不是很有趣,所以不打算写题解辣>_<250Solution 唔,这是个傻逼题,随便暴力下就好= = Code #include using namespace std; typedef pair pii; class GogoXCake { public: string solve( vector ...
分类:其他好文   时间:2015-06-02 00:27:55    阅读次数:169
Project Euler:Problem 21 Amicable numbers
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable pair and each of a and b a...
分类:其他好文   时间:2015-06-01 16:43:34    阅读次数:126
数组和键/值对的用法(文字转换相对应数字和文字)代替switch
1 string[] MethodRepayment = { "按月付息到期还本", "到期一次性还本息", "等额本息还款方式", "等额本金还款方式" };2 KeyValuePair[] pair = {3 new KeyVal...
分类:编程语言   时间:2015-05-29 13:46:14    阅读次数:102
Pair Program and Feel the Flow
Pair Program and Feel the FlowGudny Hauknes, Kari Røssland, and Ann Katrin GagnatiMAGiNE THAT YOU ARE TOTALLY ABSORBED by what you are doing— focused, dedicated, and involved. You may have lost track o...
分类:其他好文   时间:2015-05-24 10:12:13    阅读次数:155
最小生成树--prim+优先队列优化模板
prim+优先队列模板: 1 #include //大概要这些头文件 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 typedef pair pii; 8 9 int head[30],next[20...
分类:其他好文   时间:2015-05-22 16:24:29    阅读次数:133
STL-map中的插入操作详解
首先,我们可以如下使用map://#include map simap; map[string("hou")] = 1; map[string("hou")] = 2; pair value(string("ha"), 5); simap.insert(value);先看insert操作的源码: pair i...
分类:其他好文   时间:2015-05-22 11:33:46    阅读次数:295
STL MAP 使用
对于map/multimap 查找可以有多种方式。 find 返回一个iterator 是个pair count (对于map只可能是1或者0) lower_bound /upper_bound 返回 小于/大于给定value的iterator equal_range 返回一个pair 包含 low...
分类:其他好文   时间:2015-05-21 22:31:46    阅读次数:201
java entry
我希望要一个ArrayList,类似C++中的pair,可是Map.Entry是个接口,不能实例化,能够像以下这样写HashMap G = new HashMap();G.put(1, 9); G.put(4, 6); G.put(2, 8);G.put(3, 7); ArrayList> a...
分类:编程语言   时间:2015-05-20 18:10:44    阅读次数:116
Chapt.4 Utilities——auto_ptr & pair
Pair对 class Pair 可以将两个值视为一个单元,c++标准库中任何两个需要返回两个值的地方都要pair。 pair中的make_pair函数可以不显式指定类型的构造一个pair对象,如:void f(std::pair);void g(std::pair);……void foo(){ f...
分类:其他好文   时间:2015-05-19 20:29:54    阅读次数:157
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!