码迷,mamicode.com
首页 >  
搜索关键字:vector map value    ( 72712个结果
Java中Integer类的方法
字段摘要staticintMAX_VALUE 保持 int 类型的最大值的常量可取的值为 231-1。staticintMIN_VALUE 保持 int 类型的最小值的常量可取的值为 -231。staticintSIZE 以二进制补码形式表示 int 值的位数。staticClassTYPE ...
分类:编程语言   时间:2014-05-12 15:49:08    阅读次数:423
Activity之间的信使--Bundle
两个Activity之间的传参的具体做法如下: 1.新建一个Bundle类 Bundle bundle=new Bundle(); 2.向Bundle类中放入数据(类似于map) bundle.putString("key" ," value"); 3.新建一个intent对象,并将该bund...
分类:其他好文   时间:2014-05-06 09:05:48    阅读次数:349
WCF Rest Json
1、定义ServiceContract及实现 [ServiceContract] public interface IMemberService { [OperationContract] string GetData(int value); ...
分类:Web程序   时间:2014-05-06 01:03:39    阅读次数:383
hdu 1083 最大匹配
题意:N个学生 P 个课程 求最大匹配3 3 //学生 课程3 1 2 3 //课程1 匹配学生1 2 32 1 21 1典型的匹配没什么好说的#includeusing namespace std;int p,n;int map[500][500];int pre[500];int v[500.....
分类:其他好文   时间:2014-05-06 00:50:03    阅读次数:259
LeetCode---Triangle
题目链接很简单的递推,但是写代码的过程中,犯了一个严重的错误,就是我用unsigned int型变量>= 0 作为循环条件(而且是降序)的时候,出现了问题。附上代码: 1 class Solution { 2 public: 3 int minimumTotal(vector > &tria...
分类:其他好文   时间:2014-05-06 00:10:57    阅读次数:335
命名的返回值优化(Named Return Value optimization (NRVO))
命名的返回值优化: 针对返回一个局部的变量的优化,可以直接用返回的结果对象直接替代局部变量,从而减少了一个复制拷贝,从而提高效率。比如 一个函数如下:X bar(){ X xx; // .. 处理xx return xx;}而在编译器看来则是如下的代码: // 此处的_resu...
分类:其他好文   时间:2014-05-06 00:01:10    阅读次数:442
C++中const用法总结
1.const修饰普通变量和指针const修饰变量,一般有两种写法:constTYPEvalue;TYPEconstvalue;这两种写法在本质上是一样的。它的含义是:const修饰的类型为TYPE的变量value是不可变的。对于一个非指针的类型TYPE,无论怎么写,都是一个含义,即value只不可...
分类:编程语言   时间:2014-05-05 23:46:44    阅读次数:351
函数式编程的要点
1.利用返回值而不是副作用来写程序(副作用包含破坏性修改对象以及对变量赋值).2.需要返回多个值请使用multiple-value-bind和values的组合方式.3.函数式编程需要思考你要什么,而不是要怎么做.4.一个给定的调用可以安全的修改它唯一拥有的东西(函数拥有被调用函数返回的对象,但不拥...
分类:其他好文   时间:2014-05-05 23:30:48    阅读次数:358
codeforces A. Supercentral Point 题解
暴力法可过,效率O(n^2) 但是使用hash表可以把效率降到近乎O(n) 要巧妙使用两个map容器。 要对map和set容器很熟悉了,合起来一起使用。...
分类:其他好文   时间:2014-05-02 10:54:55    阅读次数:365
leetcode: Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
分类:其他好文   时间:2014-05-02 09:54:11    阅读次数:269
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!