自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 快排及其优化

#include<iostream>#include<cstdio>using namespace std;void quick_sort_v1(int *arr,int l,int r){ if (l >= r) { return; } int x = l,y = r,base = arr[l]; while(x < y){ while(x<y && arr[y] >= base) y--;.

2022-01-12 23:56:39 346

原创 二分查找算法

#include<iostream>#include<ctime>#include<cstdlib>#include<cstdio>using namespace std;int binary_search(int *arr,int n,int x){ int head = 0,tail = n-1, mid; while(head<=tail){ mid = (head+tail) >> 1;.

2022-01-11 16:06:25 145

原创 扩展欧几里得求二元一次方程

# include<stdio.h>int ex_gcd(int a,int b,int *x,int *y){ if(!b){ *x=1,*y=0; return a; } int xx,yy,ret=ex_gcd(b,a%b,&xx,&yy); *x=yy; *y=xx-a/b*yy; return ret;}int main(){ int a,b,x,y...

2021-11-30 22:31:49 508

原创 欧几里得算法

# include<stdio.h>int gcd(int a,int b){ return(b?gcd(b,a%b):a);}int main(){ int a,b; while(~scanf("%d%d",&a,&b)){ printf("gcd(%d,%d)=%d",a,b,gcd(a,b)); } return 0;}

2021-11-29 11:30:49 365

原创 高精度减法

#include<iostream>using namespace std;int n1[1005], n2[1005], ans[1005], n, m;char s1[1005], s2[1005];void func(int *n1, int *n2, int n, int m) { for (int i = 0; i <= n; i++) { for (int j = 0; j <= m; j++) { if (n.

2021-11-26 12:09:08 513

原创 高精度乘法

#include<iostream>#include<cstring>using namespace std;int n1[1005],n2[1005],ans[1005];char s1[1005],s2[1005];int main(){ cin >> s1 >> s2; n1[0] = strlen(s1); for(int i=0,j=n1[0]; i<n1[0]; i++,j--){...

2021-11-22 21:01:37 59

原创 高精度加法

#include<iostream>#include<cstring>using namespace std;int n1[1005],n2[1005],ans[1005];char s1[1005],s2[1005];//将数据读入字符串,防止超过int或long等类型的最大值int main(){ cin >> s1 >> s2; n1[0] =strlen(s1); for(int i=0, j=n1[0]; i&l...

2021-11-22 19:44:45 399

空空如也

空空如也

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

TA关注的人

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