自定义博客皮肤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)
  • 收藏
  • 关注

原创 《算法笔记》第六章源代码

P191~197#include<iostream>#include<vector>using namespace std;int main(){ vector<int> vi;//定义一个vector vector<typename> name vector<vector<int> > vo;//vector型vector vector<vector<int> > > >之间有空格

2021-09-29 21:03:17 114

原创 2021寒假集训Part 2

学习目标:巩固算法笔记第五章学习内容:2021寒假集训Part 1学习时间:2021-9-17学习产出:题单点这里补题弱鸡1 P2181 对角线#include<iostream>using namespace std;int main(){ unsigned long long n, ans; scanf("%lld",&n); ans = n * (n - 1) / 2 * (n - 2) / 3 * (n - 3) /4; printf("%lld"

2021-09-17 17:46:49 73

原创 《算法笔记》第五章源代码

P153#include<cstdio>#include<algorithm>using namespace std;bool cmp(int a, int b){ return a > b;}void to_array(int n, int num[]){ for(int i = 0; i < 4; i++){ num[i] = n % 10; n /= 10; }}int to_number(int num[]){ int sum =

2021-09-14 10:14:41 116

原创 《算法笔记》第四章源代码

P99#include<iostream>using namespace std;const int n = 8;int a[n] = {8,7,6,5,4,3,2,1};void selectSort();int main(){ selectSort(); for(int i = 0; i < n; i++){ printf("%d ",a[i]); } return 0;}void selectSort(){ for(int i = 0; i < n

2021-09-11 22:02:01 91

原创 通讯录管理软件源代码

通讯录管理软件源代码#include<iostream>#include<stdlib.h>#include<string.h>#include<conio.h>#include<time.h>using namespace std;typedef struct chsystem//chat_system的缩写{ char name[15];//姓名 char tel[20];//手机 char postcode[15];//

2021-09-07 14:08:28 703

原创 随机数

头文件要加上#include<stdlib.h>#include<time.h>其次 在main函数开头加上srand((unsigned)time(NULL);[0,RAND_MAX]#include<stdio.h>#include<stdlib.h>#include<time.h>int main(){ srand((unsigned)time(NULL)); for(int i=0;i<7;i++){ pri

2021-03-06 14:48:22 48

原创 排序专题

主要是通过《算法笔记》的学习的一些有关排序的感悟(可能有点easy)冒泡排序#include<stdio.h>const int n=10;int a[n]={10,9,8,7,6,5,4,3,2,1};void sort(){ for(int i=0;i<n-1;i++){//进行n-1趟操作 for(int j=0;j<n-i-1;j++){//每进行了一趟操作 则下一趟操作数-1 即操作数=n-1-i if(a[j]>a[j+1]){//决定从小到大

2021-03-06 14:29:24 85

原创 2021-02-03

#include<stdio.h>#include<string.h>int r;//全局变量 作为除法里的余数struct bign{ int d[1000]; int len; bign(){ memset(d,0,sizeof(d)); len=0; }};bign change(char str[]){ bign a; a.len=strlen(str); for(int i=0;i<a.len;i++){ a.d[i]=str[a.

2021-02-03 09:33:55 31

原创 2021寒假集训Part 1

学习目标:巩固算法笔记第四章学习内容:2021寒假集训Part 1学习时间:2021-01-24 25 26学习产出:题单由此进!!!以下只记录个人觉得有意思的1 P1177 【模板】快速排序#include<iostream>using namespace std;int n,a[1000001];void qsort(int l,int r)//应用二分思想{ int mid=a[(l+r)/2];//中间数 int i=l,j=r; do

2021-01-28 00:29:18 149

原创 《算法笔记学习》2021-01-24

学习目标:《算法笔记》第四章学习内容:4.5.2 简单二分法扩展4.5.3 快速幂4.6.1 two points4.6.2 归并排序4.6.3 快速排序4.7 其他高效技巧与算法学习时间:2021-1-23 19.00-0.30学习产出:P131#include<stdio.h>const double eps=1e-5;double f(double x){ return x*x;}double calSqrt(){ double left=1,righ

2021-01-25 00:56:29 84

原创 《算法笔记学习》2021-01-23

学习目标:《算法笔记》第四章学习内容:4.3 简单递归4.4 简单贪心4.5 简单二分(4.5.1)学习时间:2021-1-23 14.00-22.30学习产出:P112#include<stdio.h>int F(int n){ if(n==0){ return 1; }else{ return F(n-1)*n; }}int main(){ int n; scanf("%d",&n); printf("%d",F(n)); retu

2021-01-23 22:53:55 124

原创 《算法笔记学习》2020-01-22

学习目标:《算法笔记》第四章学习内容:1.简单排序2.sort函数的运用3.简单散列学习时间:2021-1-22 14.00-21.30学习产出:4.1.1选择排序#include <stdio.h>void selectSort(int A[],int begin,int end){//选择排序 从小到大排序begin到end 此时begin与end为数组下标 数组A为要排序的int型数组 for(begin=0;begin<end;begin++){

2021-01-22 22:50:59 76 1

空空如也

空空如也

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

TA关注的人

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