![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
徙倚遥思
这个作者很懒,什么都没留下…
展开
-
离散化---区间和问题 AcWing
区间和问题原创 2022-06-01 17:08:07 · 118 阅读 · 0 评论 -
前缀和和差分问题----个人笔记
一维前缀和求解前缀和问题不能把问题看成面积问题求解,要把问题看成一个数集问题,注意边界输出原序列中从第 l 个数到第 r 个数的和:#include<iostream>using namespace std;const int N=100010;int q[N],a[N];int n,m,l,r;int main(){ cin>>n>>m; for(int i=1;i<=n;i++) cin>>a[i];原创 2022-05-05 13:19:35 · 98 阅读 · 0 评论 -
数据结构代码实现笔记
线性表插入#include<iostream>#include<stdio.h>#include<stdlib.h>using namespace std;#define MAXSIZE 50//宏定义数据数组名字typedef int ElemType;//把int型给命名成ElemType 型typedef struct {//定义结构体 ElemType data[MAXSIZE];//结构体的数据数组 int length;//数据数组的长原创 2022-05-02 09:13:55 · 91 阅读 · 0 评论 -
快速排序模板
快速排序模板#include<iostream>using namespace std;const int N=10e6+10;int n;int q[N];void quick_sort(int q[],int l,int r){ if(l>=r) return ; int x=q[l+r>>1],i=l-1,j=r+1;//设置中间值,设置左右指针 while(i<j)//比较左右指针值的大小 {原创 2022-04-22 10:25:28 · 47 阅读 · 0 评论 -
归并排序模板
对数组排序#include<iostream>using namespace std;const int N = 100100;int a[N], tmp[N];int n;void merge_sort(int a[], int l, int r){ if (l >= r) return; int mid = r + l >> 1;//定义中间值 merge_sort(a, l, mid);//对数组的左边递归处理 merg原创 2022-04-22 10:22:28 · 48 阅读 · 0 评论 -
Android studio:“The emulator process for AVD Pixel_2_API_30 has terminiated.“
Android studio:“The emulator process for AVD Pixel_2_API_30 has terminiated.”It would seem due to the fact you are using a beta version of android studio the message “The emulator process for AVD Pixel_2_API_30 was killed.” has been changed to “The emulat原创 2021-09-09 15:35:57 · 2623 阅读 · 0 评论 -
PAT习题5-2 使用函数求奇数和 (15分)
#include <stdio.h>#define MAXN 10int even( int n );int OddSum( int List[], int N );int main(){ int List[MAXN], N, i; scanf("%d", &N); printf("Sum of ( "); for ( i=0; i<N; i++ ) { scanf("%d", &List[i]);原创 2020-11-04 17:32:14 · 405 阅读 · 0 评论 -
PTA数字金字塔
#include <stdio.h>void pyramid( int n );int main(){ int n; scanf("%d", &n); pyramid(n); return 0;}void pyramid(int n){ int i,j,k; for(i=1;i<=n;i++){ for(j=n-i;j>0;j--) printf(" ");原创 2020-10-31 17:29:10 · 383 阅读 · 0 评论 -
a,&a,*a的区别
理解数组数组的存储方式是顺序存储方式,是在内存中开辟一块连续的,大小相同的空间用来存储数据。所以内存地址是连续的。指针与数组的关系用指针表示数组:*(a+2)=a[2]用数组表示指针:a+2=&a[2]#include<studio.h>int main (void){int u[5]={100,200,300,400,500};int *p1,*p2,*p3;p1=u;//把一个地址赋值给指针p2=&u[2];printf(“p1=%d,*p1=%d,&原创 2020-10-30 19:52:09 · 1805 阅读 · 0 评论