码迷,mamicode.com
首页 >  
搜索关键字:es6 let const    ( 43838个结果
【COGS1384】鱼儿仪仗队
【题目描述】Jzyz的池塘里有很多条鱼,鱼儿们现在决定组成一个仪仗队。现在备选的N(1 2 #include 3 #include 4 #include 5 #include 6 const int maxn=100010; 7 using namespace std; 8 long lo...
分类:其他好文   时间:2014-05-23 04:41:27    阅读次数:186
hdu 4826 Labyrinth(dp)
题目链接:hdu 4826 Labyrinth 题目大意:中文题。 解题思路:不难想的递推,dp[i][j][0]从上面过来的情况,dp[i][j][1]从下面过来的情况,然后这两种情况都可以从前一列走过来。 #include #include #include using namespace std; const int N = 105; const int INF = 0...
分类:其他好文   时间:2014-05-22 22:42:28    阅读次数:350
提高编程效率的C++编程箴言
对于单纯常量,最好以const对象或enums替换#defines对于形似函数的宏,最好改用inline函数替换#define将某些东西声明为const可帮助编译器侦测出错误用法。const可被施加于任何作用域内的对象、函数参数、函数返回类型、成员函数本体。当const和non-const成员函数有着实质等价的实现时,令non-const版本调用const版本可避免代码重复。确定对象被使用前已经被...
分类:编程语言   时间:2014-05-22 17:09:29    阅读次数:263
【原创】高精度(压位储存)模板
无聊写了个高精度模板玩玩...... 1 /* 2 高精度(压位储存) 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 const int MAX=10005;//最长长度 10 using ...
分类:其他好文   时间:2014-05-21 19:47:19    阅读次数:588
hdu 2112 HDU Today 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2112题目意思:又是求最短路的,不过结合埋字符串来考查。 受之前1004 Let the Balloon Rise 学到用map 的解法做之后,有点蠢蠢欲动,当时见到要用字典树做有点吓坏了(之前看过下,....
分类:其他好文   时间:2014-05-21 18:51:53    阅读次数:325
C++宽窄字符串转换
首先,贴出我给出的解决方案:http://files.cnblogs.com/xuejianhui/utils.rar再则,贴出网上最常见的例子:#include std::string ws2s(const std::wstring& ws){ std::string curLocale =...
分类:编程语言   时间:2014-05-21 18:46:28    阅读次数:400
poj1195 mobile phones 【二维树状数组】
一次AC 二维树状数组,有模版很好办 注意二维树状数组这个下标是[1][1]的 #include #include #include #include #include #include using namespace std; const int Max = 1030; int row, col, ar[Max][Max]; // 二维的其实下标为[1][1],这个要记得。 ...
分类:其他好文   时间:2014-05-21 16:23:34    阅读次数:271
POJ1182 食物链 【并查集变种】
挺简单的 N个元素扩展为 3*N个 i-A i-B i-C A吃B吃C吃A 挑战程序设计的89面 #include #include #include #include #include using namespace std; int N,K; const int MAX_N=333333; //并查集 int par[MAX_N]; int rank[MAX_N];//树的...
分类:其他好文   时间:2014-05-21 16:03:48    阅读次数:216
令人纠结的两行代码
以下内容系原创,转载请务必注明地址 主要参考资料:我在 Stackoverflow 上提的问题 Why the first is right but the second is wrong ? 这令人纠结的两行代码如下: const char *cval = "nothing"; // 正确 int *ival = {1, 2, 3, 4}; // 错误...
分类:其他好文   时间:2014-05-21 15:32:47    阅读次数:277
C++ Primer 学习笔记_82_模板与泛型编程 --类模板成员[续2]
模板与泛型编程--类模板成员[续2]六、完整的Queue类Queue的完整定义:template class Queue; template ostream &operator &); template class QueueItem { friend class Queue; friend ostream & operator(ostream &,const Q...
分类:编程语言   时间:2014-05-21 14:07:20    阅读次数:304
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!