自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 收藏
  • 关注

原创 Matlab-Moore-Penrose广义逆矩阵

>> clear A=[16 2 3 13; 5 11 10 8; 9 7 6 12; 4 14 15 1] A = 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 >> [U,S,V]=svd(A) U = -0.5...

2018-03-31 22:52:29 5391

原创 C++-砝码盘(蓝桥杯)

#include <bits/stdc++.h> using namespace std; int a[5]={1,3,9,27,81}; int x; vector<int>v1; vector<int>v2; bool flag=false; void dfs(int i,int left,int right) { if(flag) { ...

2018-03-31 18:00:04 620

原创 C++-花朵数(蓝桥杯)

#include <iostream> #include <string> #include <sstream> #include <cstring> #include <algorithm> using namespace std; stringstream os; stringstream os1; //菜鸡瑟瑟发抖,为毛我还是这么的...

2018-03-31 17:32:20 916

原创 C++-大数乘法模拟

#include <iostream> #include <sstream>//这里的头文件是sstream,不是stringstream,应该是缩写吧。 #include <cstring> using namespace std; stringstream os; //C++实现大数乘法,加法比乘法写起来要简单些,其实也不是很复杂 //菜鸡瑟瑟发抖 int ...

2018-03-31 16:21:49 444

原创 C++-大数加法模拟

#include <iostream> #include <sstream>//这里的头文件是sstream,不是stringstream,应该是缩写吧。 #include <cstring> using namespace std; stringstream os; //C++实现大数加法,加法比乘法写起来要简单些,其实也不是很复杂 //菜鸡瑟瑟发抖 in...

2018-03-31 15:51:39 463

原创 C++-stringstream的新用法

#include <bits/stdc++.h> using namespace std; //以前对于stringstream,我以为只能实现一个数值型字符串和整型 //数之间的转换,其实可以多个整数转成一个字符串,或者 //可以将一个字符串转成数组,插入运算符和提取运算符都已经重载好了 int main(void) { stringstream os; os.cle...

2018-03-31 15:27:10 154

原创 C++ -AVL树代码理解

//下面是我手写的AVL树/*    @   @ ----->  LL(我觉的是左偏,分不清楚到底叫法叫什么了)  @  @   @------>  RR    @  @    @----->  LR  @     @   @ ----->  RL(从最下面开始往上旋转,反正最后将最下面的那个节点移到了最上面     @*/#include <bits/stdc++....

2018-03-30 20:12:47 429

原创 C++-扩展欧几里得算法

#include <bits/stdc++.h>using namespace std;//求a,b的最大公约数//a*x+b*y=gcd(a,b)//并不只是a*x+b*y=1这种类型的int gcd(int a,int b){ if(b==0) { return a; } else { return gcd(b,a%b); }}int xx;void exgcd(int &am...

2018-03-29 22:40:29 2155

原创 堆排序-C++详细注释

堆排序(注释)给下面链接上的堆排序加了一点点自己的注释,菜鸡瑟瑟发抖参考文献 http://blog.csdn.net/lzuacm/article/details/52853194#include<cstdio>#include<iostream>#include<cstring>#include<algorithm>using namespace...

2018-03-29 18:10:35 288

原创 C++-upper_bound和lower_bound函数坑点总结

#include <bits/stdc++.h> using namespace std; int a[10]={10,10,10,10,50,60,70,80,90,100}; int main(void) { int i=11;//当元素不存在时,lower_bound和upper_bound返回的值是一样的,就比较尬 cout <<lower_bound(a,a...

2018-03-28 20:30:58 480

原创 C++-n个数中选择m个数打印输出-暴力dfs

#include <bits/stdc++.h> using namespace std; //说社么暴力啊,不就是dfs吗,怼你 int a[7]={10,22,4,3,5,6,9}; int n=7; vector<int>v; int cnt=0; //rest--剩余的元素个数 //index--当前可以选择的起始下标,开始从index=0开始 void dfs(...

2018-03-28 17:36:59 658

原创 关于对自己C++的next_permutation的一点提醒

#include <bits/stdc++.h> using namespace std; int main(void) { int a[4]={1,2,4,3};//注意next_permutation并不总是打印n!个的 int cnt=0; do { cnt++; cout <<"cnt="<&l...

2018-03-28 15:58:00 278

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除