C++
C++
AutoMan-USTC
SLAM,自动驾驶
展开
-
【noip2014普及】子矩阵
直接暴力搜索时间复杂度太高。 方法:暴力搜索行,再动态规划列 代码示例: #include<cmath> #include<cstdio> #include<iostream> #include<algorithm> #define MAXN 20 using namespace std; int n, m, r, c, ans;//定义...原创 2019-10-27 23:03:25 · 327 阅读 · 0 评论 -
求数列中的固定长度的等差子序列个数
C++代码: #include<cstdio> #include<iostream> #include<algorithm> using namespace std; const int maxn = 30; const int maxT = 10;//输入最大轮数 int T, n, k; int p,s;//p用来计数对应搜索公差为a的序列长度,s用...原创 2019-11-23 09:51:17 · 347 阅读 · 0 评论 -
因数分解
因数分解 在这里插入代码片原创 2019-12-07 09:00:54 · 215 阅读 · 0 评论 -
c++程序-小猫成长记
程序示例: #include<iostream> using namespace std; const int maxn = 500; int f, w, s, m, n, h, sum, a[4]; //Flag二维数组不断不重复地保存当前已找到的成长方式,flag保存当前找到的一种成长方式 //如示例中一种方式:flag={3 0 1 1}表示1*3+2*0+3*1+4*1=...原创 2019-12-21 09:00:35 · 279 阅读 · 0 评论 -
N皇后问题(c++)
N皇后问题(c++) #include <iostream> #include<cmath> using namespace std; int queenPos[10];//保存搜索结果,每一行对应的列标,这里行列的标号均从0开始 int count=0;//计数 void NQueen(int n,int N);//搜索第n行 int main() { ...原创 2019-11-10 22:52:29 · 346 阅读 · 0 评论