码迷,mamicode.com
首页 >  
搜索关键字:vector    ( 11651个结果
leetcode-----39. 组合总和
链接:https://leetcode-cn.com/problems/combination-sum/ 代码(dfs) class Solution { public: vector<vector<int>> ans; vector<int> path; vector<vector<int>> c ...
分类:其他好文   时间:2020-07-06 16:29:07    阅读次数:61
leetcode-473 火柴拼正方形
class Solution { public: bool makesquare(vector<int>& nums) { int l=nums.size(); int sum=0; for(int i=0;i<l;i++) { sum+=nums[i]; } if(sum==0 || (sum/4 ...
分类:其他好文   时间:2020-07-06 16:11:42    阅读次数:36
Stack 类的应用(判断有效的括号)
栈是Vector的一个子类,它实现了一个标准的后进先出的栈。 这是一道LeetCode的简单算法题。 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。 有效字符串需满足: 左括号必须用相同类型的右括号闭合。 左括号必须以正确的顺序闭合。 注意空字符串可被 ...
分类:其他好文   时间:2020-07-06 11:13:51    阅读次数:53
LeetCode52. N皇后 II
这题和LeetCode第51题做法一样,只不过不是记录具体方案,而是个数。分析见第51题。 代码如下: class Solution { int res = 0; int n; vector<string> path; vector<bool> cols, diagram, anti_diagram ...
分类:其他好文   时间:2020-07-06 01:04:24    阅读次数:54
CF997C Sky Full of Stars
题目传送门 分析: 直接膜拜大佬博客OrzOrzOrz #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<iostream> #include<map> # ...
分类:其他好文   时间:2020-07-05 22:44:57    阅读次数:59
luogu P3690【模板】Link Cut Tree(动态树)
#include<iostream> #include<cstring> #include<algorithm> #include<cmath> #include<cstdlib> #include<climits> #include<stack> #include<vector> #include ...
分类:其他好文   时间:2020-07-05 19:30:34    阅读次数:54
题解 CF1375E Inversion SwapSort(构造)
先考虑一个排列的情况。从边界入手,先把a[n]搞成n,同时要保证前面的数,相对大小关系不变。可以依次交换(pos[a[n]+1],n), (pos[a[n]+2],n),...,(pos[n],n)。完成这一轮操作后,转化为一个规模减1的子问题,继续做即可。当不是一个排列时,对相同的数,我们强行令位... ...
分类:其他好文   时间:2020-07-05 17:48:54    阅读次数:149
Games101--Assignment2
Gams101的Assignment2的要求如下: 修改函数rasterize_triangle(const Triangle& t)。 该函数的内部工作流程如下: 创建三角形的2 维bounding box。 遍历此bounding box 内的所有像素(使用其整数索引)。然后,使用像素中心的屏幕 ...
分类:其他好文   时间:2020-07-05 15:39:53    阅读次数:192
题解-CF1375E Inversion SwapSort
给定长度为 $n$ 的序列 $a_i$,求一种将每个逆序对下标 $(u,v)$ 的排序,使依次交换每个 $(a_u,a_v)$ 后,$a_i$ 不减。 数据范围:$1\le n\le 1000$,$1\le a_i\le 10^9$。 ...
分类:其他好文   时间:2020-07-05 15:32:05    阅读次数:59
支持向量机-分类器之王
1. 支持向量机(Support Vector Machine, SVM): 一种知名的二元线性/非线性分类方法,由俄罗斯的统计学家Vapnik等人所提出。它使用一个非线性转换(Nonlinear Transformation)将原始数据映像(Mapping)至较高维度的特征空间 (Feature ...
分类:其他好文   时间:2020-07-05 15:28:57    阅读次数:70
11651条   上一页 1 ... 41 42 43 44 45 ... 1166 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!