自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 pip更新方法(依次尝试下面三种)

pip更新方法(依次尝试下面三种)1,使用python -m pip install --upgrade pip升级失败2,使用python -m pip install -U --force-reinstall pip依然失败3,使用pip install --user --upgrade pip成功升级

2021-02-10 22:18:24 11778 5

原创 libsvm(for python WIndows10 64位)安装步骤

最近大数据过程中要用到支持向量机来处理数据,查阅资料发现需要用到台湾牛人写的一个svm的支持库libsvm,这个库在下面这个地址下载就好了:http://www.cr173.com/soft/59793.html,下载以后就是安装问题了。其实libsvm不需要安装,直接解压就好了,我解压到了这个目录下:D:\Program Files直接在python IDEL下from svmutil import *会报错。下面是解决方案。1.在libsvm下有几个文件夹,要特别关注一个叫windows的,它里

2021-01-25 10:54:30 572

原创 初中18题

虽然已经进入大学,初中关于平面几何的几个公式定理依旧如此熟悉!找了半天,还是没找到铅笔。。。(初中班主任老师千般叮咛养成的作图习惯看来是没法保持了…)...

2020-03-17 21:49:21 337

原创 DreamGrid has just found an undirected simple graph with $n$ vertices and no edges (that's to say, i

DreamGrid has just found an undirected simple graph with nnn vertices and no edges (that’s to say, it’s a graph with nnn isolated vertices) in his right pocket, where the vertices are numbered from 1 ...

2020-03-15 16:23:08 600

原创 DreamGrid has an integer sequence $a_1, a_2, \dots, a_n$ and he likes it very much. Unfortunately, h

DreamGrid has an integer sequence a1,a2,…,ana_1, a_2, \dots, a_na1​,a2​,…,an​ and he likes it very much. Unfortunately, his naughty roommate BaoBao swapped two elements aia_iai​ and aja_jaj​ (1≤i<j...

2020-03-15 13:35:32 1218

原创 城堡问题

#include<iostream>#include<cstring>int Room[55][55],Color[55][55];int RoomNum=0,RoomArea=0,MaxRoomArea=0;using namespace std;void dfs(int i,int j){ if(Color[i][j]) return ; RoomAr...

2020-02-23 22:24:30 254

原创 数字三角形 数字金字塔 递推 动态规划 空间优化

#include<iostream>using namespace std;# define MAX 1010int D[MAX][MAX];int n;int *maxSum;int main(){ cin>>n; for(int i=1;i<=n;i++) for(int j=1;j<=i;j++) cin>>D[i][...

2020-02-14 20:39:29 486

原创 数字三角形 数字金字塔 递推 动态规划

#include<iostream>using namespace std;#define MAX 1010int D[MAX][MAX];int n;int maxSum[MAX][MAX];int main(){ cin>>n; for(int i=1;i<=n;i++) for(int j=1;j<=i;j++) cin>&...

2020-02-14 20:29:57 513

原创 数字三角形

#include<iostream>const int MAX= 1020;using namespace std;int n;int D[MAX][MAX];int maxSum[MAX][MAX];int MaxSum(int i,int j){ if(maxSum[i][j]!=-1) return maxSum[i][j]; if(i==n) maxSu...

2020-02-14 20:17:45 177

原创 数字三角形

#include<iostream>using namespace std;#define MAX 101int D[MAX][MAX];int n;int MaxSum(int i,int j){ if(i==n) return D[i][j]; int x=MaxSum(i+1,j); int y=MaxSum(i+1,j+1); return max(x,...

2020-02-14 16:05:27 181

原创 快速排序

#include<iostream>using namespace std;void swap(int &a,int &b){ int temp=a; a=b; b=temp;}void QuickSort(int a[],int s,int e){ if(s>=e) return ; int k=a[s]; int i=s,j=e; w...

2020-02-13 20:58:01 129

原创 归并排序

#include<iostream>using namespace std;void Merge(int a[],int s,int m,int e,int temp[]){ int pb=0; int p1=s,p2=m+1; while(p1<=m&&p2<=e){ if(a[p1]<a[p2]){ temp[pb++]=a[p...

2020-02-13 20:24:50 137

原创 二分查找求方程的根

double EPS=1e-6;double f(double x){ return x*x*x-5*x*x+10*x-80;}int main(){ double root,x1=0,x2=100,y; root=x1+(x2-x1)/2; int triedTimes=1; y=f(root); while(fabs(y)>EPS){ if(y>0) x...

2020-02-12 21:13:41 749

原创 二分查找

int BinarySearch(int a[],int size ,int p){ int l=0; int r=size-1; while(l<r){ int mid=l+(l+r)/2; if(p==a[mid]) return mid; if(p>a[mid]) l=mid+1; if(p<a[mid]) r=mid-1; ...

2020-02-12 21:05:38 173

原创 算24

算24#include<iostream>#include<cmath>using namespace std;double a[5];#define EPS 1e-6bool isZero(double x){ return fabs(x)<=EPS;}bool count24(double a[],int n){ if(n==1){ if(...

2020-02-12 20:37:06 184

原创 放苹果

放苹果#include<iostream>using namespace std;int f(int m,int n){ if(n>m) return f(m,m); if(m==0) return 1; if(n==0) return 0;}int main(){ int t,m,n; cin>>t; while(t--){ cin&...

2020-02-12 20:11:04 114

原创 爬楼梯

爬楼梯#include<iostream>using namespace std;int N;int stairs(int n){ if(n==1) return 1; if(n==2) return 2; return stairs(n-1)+stairs(n-2);} int main(){ while(cin>>N){ cout<...

2020-02-12 00:12:36 169

原创 表达求值

表达求值#include#include#includeusing namespace std;int factor_value();int term_value();int expression_value();int main(){cout<<expression_value()<<endl;return 0;}int expression_va...

2020-02-12 00:02:19 132

原创 逆波兰表达式

#include<iostream>#include<cstdlib>using namespace std;double exp(){ char s[20]; cin>>s; switch(s[0]){ case '+':return exp()+exp(); case '-':return exp()-exp(); case '*':...

2020-02-11 23:27:07 153

原创 N皇后问题

#include<iostream>#include<cmath>using namespace std;int N;int queenPos[100];void Nqueen(int k);int main(){ cin>>N; Nqueen(0); return 0;}void Nqueen(int k){ int i; if(k=...

2020-02-11 23:05:47 130

原创 汉诺塔问题

#include<iostream>using namespace std;void Hanoi(int n,char src ,char mid ,char dest){ if(n==1){ cout<<src<<"->"<<dest<<endl; return ; } Hanoi(n-1,src,dest,m...

2020-02-11 22:48:44 110

原创 高精度除以低精度

#include<iostream>#include<cstring>#include<cstdio>using namespace std;int main(){ char a1[100]; int a[100],c[100],lena,x=0,lenc,b; memset(a,0,sizeof(a)); memset(c,0,sizeof(c...

2020-01-05 22:16:24 553

原创

https://damo.alibaba.com/events/57添加链接描述

2020-01-05 22:11:37 94

原创 进制转化 10进制转化为2进制,8进制,16进制

#include<iostream>#include<cstdlib>using namespace std;void turndate(int ,int );char ch[6]={'A','B','C','D','E','F'};int main(){ int n; cin>>n; turndate(n,2); turndate(n,8);...

2020-01-05 22:02:25 170

原创 高精度乘法

#include<iostream>#include<cstring>#include<cstdio>using namespace std;int main(){ char a1[101],b1[101]; int a[101],b[101],c[101],lena,lenb,lenc; memset(a,0,sizeof(a)); memse...

2020-01-05 21:39:48 159

原创 高精度减法

#include<iostream>#include<cstring>#include<cstdio>using namespace std;int main(){ int a[233],b[233],c[233],lena,lenb,lenc; char a1[233],b1[233]; memset(a,0,sizeof(a)); memse...

2020-01-05 21:29:51 232

原创 高精度加法

#include<iostream>#include<cstdio>#include<cstring>using namespace std;int main(){ char a1[100],b1[100]; int a[100],b[100],c[100],lena,lenb,lenc,x=0; memset(a,0,sizeof(a)); m...

2020-01-05 21:09:35 132

原创 高精度计算

高精度计算(1)数据接收和存储方法可采用字符串方式输入。(2)进位,借位处理加法进位:c[i]=a[i]+b[i];if(c[i]>=10){ c[i]%=10; ++c[i+1];}减法借位:if(a[i]<b[i]){ --a[i+1]; a[i]+=10;}c[i]=a[i]-b[i];乘法进位:c[i+j-1]=a[i]*b[j]+x+c[...

2020-01-05 20:55:20 360

原创 编程输出1000到2000间的所有素数(质数)。一个大于1的自然数,除了1和它本身外,不能被其他自然数整除。 输出格式要求:按从小到大顺序输出,每个输出数据占据一行。 输出样例: 1009 (注

编程输出1000到2000间的所有素数(质数)。一个大于1的自然数,除了1和它本身外,不能被其他自然数整除。输出格式要求:按从小到大顺序输出,每个输出数据占据一行。输出样例:1009 (注:运行时的输出)1013 ...

2020-01-04 14:30:07 7166

原创 第一天悟空吃掉桃子总数一半多一个,第二天又将剩下的桃子吃掉一半多一个,以后每天吃掉前一天剩下的一半多一个,到第n天准备吃的时候只剩下一个桃子。问:他第一天开始吃的时候桃子一共有多少个?(递归:倒序关系

第一天悟空吃掉桃子总数一半多一个,第二天又将剩下的桃子吃掉一半多一个,以后每天吃掉前一天剩下的一半多一个,到第n天准备吃的时候只剩下一个桃子。问:他第一天开始吃的时候桃子一共有多少个?(递归:倒序关系:f(n)= 2*f(n-1)+2)输入输出样例:3 (注:运行时的输入)10 (注:运行时的输出)#include <stdio.h>int f(int m){ if(m...

2020-01-04 14:29:29 1883

原创 最大公约数

#include<iostream>using namespace std;int gcd(int ,int );int main(){ int m,n; cin>>m>>n; cout<<"gcd="<<gcd(m,n)<<endl; return 0;}int gcd(int m,int n){ ret...

2020-01-04 14:28:53 185

原创 单链表操作

1.建立链表 #include<iostream>using namespace std;struct Node{ int date; Node *next;}; Node *head,*p,*r;int x;int main{ cin>>x; head=new Node; r=head; while(x!=-1){ p=new Node;...

2020-01-04 14:28:19 214

原创 冒泡排序 函数调用

#include<iostream>#include<ctime>#include<cstdlib>using namespace std;int main(){ void bubble(int[],int n); int a[100]; int n; cin>>n; srand((unsigned)time(NULL)); fo...

2020-01-03 22:09:45 3134

原创 字符串判等

#include<iostream>#include<cstdio>#include<cstring>using namespace std;const int N=256;char s1[N],s2[N],a[N],b[N];int l1,l2;int main(){ gets(s1); gets(s2); strlwr(s1); st...

2020-01-03 21:52:43 1380

原创 按字典序输出国家名

#include<iostream>#include<cstring>#include<cstdio>using namespace std;int main(){ char t[21]; char cname[11][21]; int n; cin>>n; for(int i=0;i<n;i++){ gets(cname...

2020-01-03 21:40:49 952

原创 过滤空格

#include<cstdio>#include<iostream>using namespace std;char s[20];int main(){ while(scanf("%s",s)==1){ printf("%s ",s); } return 0;}

2020-01-03 21:30:19 187

原创 约瑟夫环报数

#include<iostream>#include<cstring>#include<iomanip>using namespace std;int main(){ int a[100]; memset(a,0,sizeof(a)); int n,m; cin>>n>>m; int out=0,cnt1=0,cnt=0...

2020-01-03 21:22:56 194

原创 蛇形填数

#include<iostream>#include<cstring>#include<iomanip>using namespace std;int main(){ int a[101][101]; memset(a,0,sizeof(a)); int tot=1; int n; cin>>n; a[1][n]=tot; in...

2020-01-03 21:07:01 91

原创 判断是否回文数

#include<iostream>using namespace std;int main(){ char ch,letter[101]; int i=0,j=1; cin>>ch; while(ch!='.'){ i++; letter[i]=ch; cin>>ch; } while((j<i)&&(lett...

2020-01-03 19:47:14 160

原创 打印杨辉三角

#include<iostream>#include<iomanip>using namespace std;int main(){ int n; cin>>n; int a[101][101]={0}; a[1][1]=1; for(int i=2;i<=n;i++){ a[i][1]=1; a[i][i]=1; for(in...

2020-01-03 19:40:41 140

空空如也

空空如也

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

TA关注的人

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