码迷,mamicode.com
首页 >  
搜索关键字:push_back    ( 578个结果
实战c++中的vector系列--emplace_back造成的引用失效
上篇将了对于struct或是class为何emplace_back要优越于push_back,但是还有一些细节没有提及。今天就谈一谈emplace_back造成的引用失效。直接撸代码了:#include #include #include using namespace std;int main() { vector ive...
分类:编程语言   时间:2015-12-19 13:48:44    阅读次数:238
hdu 4888 Redraw Beautiful Drawings 网络流
题目链接一个n*m的方格, 里面有 2 using namespace std; 3 #define pb(x) push_back(x) 4 #define ll long long 5 #define mk(x, y) make_pair(x, y) 6 #define lson l,...
分类:Windows程序   时间:2015-12-17 20:37:01    阅读次数:194
STL中list中push_back(对象)保存对象的内部实现
STL中list中push_back(对象)保存对象的内部实现1. 在容器中,存放的是对象拷贝 #include#includeusing namespace std;class A{ int i; static int num;public: A():i(0){ cout li...
分类:其他好文   时间:2015-12-17 18:57:28    阅读次数:190
hdu 3980 Paint Chain sg函数
题目链接给一个长度为n的环, 两个人轮流涂色, 每次涂m个连续的, 无法继续涂了就输。 1 #include 2 using namespace std; 3 #define pb(x) push_back(x) 4 #define ll long long 5 #define mk(x, y) m...
分类:其他好文   时间:2015-12-16 21:20:03    阅读次数:171
hdu 3529 Bomberman - Just Search! 重复覆盖
题目链接依然是重复覆盖的模板.... 1 #include 2 using namespace std; 3 #define pb(x) push_back(x) 4 #define ll long long 5 #define mk(x, y) make_pair(x, y) 6 #d...
分类:其他好文   时间:2015-12-15 20:58:08    阅读次数:159
codeforces 535D. Tavas and Malekas KMP
题目链接又复习了一遍kmp....之前都忘光了 1 #include 2 using namespace std; 3 #define pb(x) push_back(x) 4 #define ll long long 5 #define mk(x, y) make_pair(x, y) 6 #de...
分类:其他好文   时间:2015-12-14 10:40:11    阅读次数:308
实战c++中的string系列--string的连接(+= or append or push_back)
string的连接也是经常用到的,string重载了一些运算符: 首先看一看重载+运算符,用于串联两个字符串对象: 源码:template basic_string operator+( const basic_string<C...
分类:移动开发   时间:2015-12-13 22:01:56    阅读次数:542
2016/12/10 leetcode1:Summary Ranges
这是Array里的第一题。题意是找出排序好的数组的数字范围集合。记录的知识点:1, c++中将数字转化为字符串stringstream ss;ss vecStr;string tem;vecStr.push_back(tem);3, 遍历vectorvector::iterator iter;for...
分类:其他好文   时间:2015-12-10 21:45:03    阅读次数:173
ZOJ 3209 Treasure Map 精确覆盖
题目链接精确覆盖的模板题, 把每一个格子当成一列就可以。S忘记初始化TLE N次, 哭晕在厕所...... 1 #include 2 using namespace std; 3 #define pb(x) push_back(x) 4 #define ll long long 5 #de...
分类:其他好文   时间:2015-12-10 21:42:20    阅读次数:191
zoj 2589 Matrix Searching 二维线段树
题目链接给一个n*n的矩阵, 给q个查询, 每次给出x1, y1, x2, y2, 求这个矩阵中的最小值。代码基本上和上一题相同... 1 #include 2 using namespace std; 3 #define pb(x) push_back(x) 4 #define ll lo...
分类:其他好文   时间:2015-12-07 17:47:41    阅读次数:161
578条   上一页 1 ... 37 38 39 40 41 ... 58 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!