![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
总结
weixin_45760415
这个作者很懒,什么都没留下…
展开
-
笔记
tie(x_depth,x_parent,x_found)=tuple{depth,parent,true}可实现批量赋值,tie绑定的是变量,tuple是值。如果queue的元素是pair类型,赋值的时候可以 (pair(first,second)),或者(first,second)。取值时可以 auto&&[first,second]=q.pop()vector<vector< int >>res, res.push_back(vector< int.原创 2021-05-17 09:15:07 · 62 阅读 · 0 评论 -
位运算
builtin函数•int __builtin_ffs (unsigned int x)返回x的最后一位1的是从后向前第几位,比如7368(1110011001000)返回4。•int __builtin_clz (unsigned int x)返回前导的0的个数。•int __builtin_ctz (unsigned int x)返回后面的0个个数,和__builtin_clz相对。•int __builtin_popcount (unsigned int x)返回二进制表示中1的个数.原创 2021-05-10 18:12:46 · 44 阅读 · 0 评论 -
stl总结
目录1.sort2.string3.vector4.stack5.queue6.map7.map8.dequeue9.list1.sort头文件algorithm sort(地址1,地址2) 排序算法,对地址1到地址2-1的数据排序2.string头文件 string STL string C语言中用指针或者数组定义字符串,用指针打印 C++中直接用cout打印 获取一行字符串: cin和scanf遇到空格都会结束,获取一行字符,可以用getline(cin,字符串)原创 2021-04-16 10:01:11 · 240 阅读 · 0 评论