码迷,mamicode.com
首页 >  
搜索关键字:vector    ( 11651个结果
最长上升子序列
最长上升子序列 思路: 去过前面的数字小于当前数字,当前数字直接加入 否则 找到数组里面第一个>它的数字替换上 1 #include<bits/stdc++.h> 2 3 using namespace std; 4 int n,a; 5 vector<int> ve; 6 int main() { ...
分类:其他好文   时间:2020-07-19 11:44:52    阅读次数:52
Operation Love
C. Operation Love 先判断给定点是顺时针还是逆时针,然后再判断长度为6的边是在长度为9的边的左边还是右边即可 // Created by CAD #include <bits/stdc++.h> using namespace std; bool judge(vector<doubl ...
分类:其他好文   时间:2020-07-19 11:31:44    阅读次数:76
C++ unique去重的常用用法
1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 5 using namespace std; 6 7 int main() 8 { 9 vector<int> nums{1,3,4,6,5,3,2,4,7,5}; ...
分类:编程语言   时间:2020-07-19 00:53:48    阅读次数:95
字符串拼接
题目:给定3个字符串a, b, c。你的任务是判断c是否可由a, b拼接出来。 c可由a, b拼接则意味着存在一种情况,将c拆分成两个子字符串,这两个子字符串分为等于a, b。注,c在拆分过程中,c中的每个字符只能属于两个子串中的一个。 输入包含多组样例,样例数不超过20。 第一行一个整数T,表示样 ...
分类:其他好文   时间:2020-07-18 22:49:55    阅读次数:88
逐层打印二叉树
struct BinaryTreeNode { int nvalue=0; BinaryTreeNode* pleft = nullptr; BinaryTreeNode* pright = nullptr; BinaryTreeNode* parent = nullptr;};vector<vec ...
分类:其他好文   时间:2020-07-18 22:37:14    阅读次数:87
1395. Count Number of Teams
问题: 给定一组带有评分rating的士兵序列。 求从中挑出3个士兵 i, j, k (i<j<k)为一个小组,使得第 i, j, k 名士兵的 rating递增or递减。 这样的小组有多少个。 Example 1: Input: rating = [2,5,3,4,1] Output: 3 Exp ...
分类:其他好文   时间:2020-07-18 16:04:17    阅读次数:67
C++常用STL
C++基本操作 vector #####如何查找 第二维?或者第一维 【链接】对vector中的pair进行多次find操作 class isE{ isE(int val) :User(val){} bool operator()(const pair<int,int>& e)const{ retu ...
分类:编程语言   时间:2020-07-18 13:48:27    阅读次数:77
leetcode-----96. 不同的二叉搜索树
链接:https://leetcode-cn.com/problems/unique-binary-search-trees/ 代码 class Solution { public: int numTrees(int n) { vector<int> f(n + 1); f[0] = 1; for ...
分类:其他好文   时间:2020-07-18 11:25:21    阅读次数:56
EOJ Monthly 2020.7 Sponsored by TuSimple E.因数串 数学/ 构造
给定一个n表示a的质因数个数。 接下来n行给出质数及其指数。 按要求输出其因数,满足如下要求: 当前数是前一个数通过乘一个质数或者除以一个质数得到。 反正就是构造嘛。对于每一个i,必然要遍历前面的所有情况。其实就是升升降降。 vector<ll> ans; vector<ll> p(16); vec ...
分类:其他好文   时间:2020-07-18 11:22:49    阅读次数:70
AC自动机模板
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=5e5+10; struct node{ int cnt; node * nxt[27]; node * fail; vector<node ...
分类:其他好文   时间:2020-07-18 00:44:51    阅读次数:57
11651条   上一页 1 ... 34 35 36 37 38 ... 1166 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!