码迷,mamicode.com
首页 >  
搜索关键字:r语言中的 vector    ( 11651个结果
cocos2dx 3.x Value、Vector和Map的认识
1. Value cocos2d::Value 是一个包含了很多原生类型(int,float,double,bool,unsigned char,char* 和 std::string)外 加std::vector, std::unordered_map 和 std::unordered_map 的类。 你可以把所有上面的提及的原生类型放入 cocos2d::Value 对象中,然后将它...
分类:其他好文   时间:2014-11-04 01:37:16    阅读次数:191
[LeetCode]Subsets II生成组合序列
class Solution {//生成所有【不重复】的组合。生成组合只要采用递归,由序列从前往后遍历即可。至于去重,根据分析对应的递归树可知,同一个父节点出来的两个分支不能一样(即不能与前一个元素一样,且前一个元素要与之在同层)。 public: int *b,n; vectora; vector >ans; void dfs(int id,int len){ ...
分类:其他好文   时间:2014-11-04 01:36:48    阅读次数:148
PAT 1051 Pop Sequence
#include #include #include using namespace std;bool push_validate(int &pre_push, int max_push, int cur, vector& stack, int mcap) { if (pre_push >= ...
分类:其他好文   时间:2014-11-04 01:28:04    阅读次数:248
[LeetCode]
class Solution {//用set判断一个元素是否存在于集合中O(logn)。用到的一个优化是连续的x个数对应的序列长度都是一样的,可以通过判断元素是否遍历过来避免查找。没有这一步会超时。有的也用unordered_set代替set,据说这是hash表,O(1),更快。 public: int longestConsecutive(vector &v) { if(...
分类:其他好文   时间:2014-11-04 00:12:22    阅读次数:239
《算法导论》杂记 - 第二章 算法基础
// ascvoid insertionSortAsc(vector &v){ int len = v.size(); for (int i = 1; i = 0 && v[j] > key) { v[j + 1] = v[j]; ...
分类:编程语言   时间:2014-11-03 22:09:00    阅读次数:154
Topcoder SRM 638 DIV 2 (大力出奇迹)
水题,就是一个暴力。大力出奇迹。 Problem Statement   There is a narrow passage. Inside the passage there are some wolves. You are given a vector size that contains the sizes of those wolves, fro...
分类:其他好文   时间:2014-11-03 17:51:41    阅读次数:212
HDU3062-Party(2-SAT)
题目链接 思路:2-SAT的模版题 代码: #include #include #include #include #include using namespace std; const int MAXN = 10005; struct TwoSAT{ int n; vector g[MAXN * 2]; bool mark[MAX...
分类:其他好文   时间:2014-11-03 11:33:52    阅读次数:302
Linux Interactive Exploit Development with GDB and PEDA
Exploit Development Process● Occupy EIP● Find the offset(s)● Determine the attack vector● Build the exploit● Test/debug the exploitpeda 是一款由python寫的ex...
分类:数据库   时间:2014-11-03 10:08:27    阅读次数:825
PAT 1042 Shuffling Machine
#include #include #include using namespace std;char tbl[5] = {'S', 'H', 'C', 'D', 'J'};void shuffle(vector &card, vector &rnd) { int rlen= rnd.size...
分类:系统相关   时间:2014-11-02 22:21:00    阅读次数:199
C++ primer 学习笔记之容器insert
今天在做练习9.22时,始终出现segments fault。最后才发现原来是自己对“容器insert之后迭代器会失效”的理解不够透彻。题目如下:假定iv是一个int的vector,下面的程序存在什么错误?你将如何修改?1 auto iter = iv.begin();2 auto mid = iv...
分类:编程语言   时间:2014-11-02 21:00:22    阅读次数:216
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!