摘要:
目录 快速排序 归并排序 逆序对 阅读全文
posted @ 2021-08-28 23:40
luckydrawbox
阅读(10)
评论(0)
推荐(0)
摘要:
对一个下标在 [l,r][l,r][l,r] 间的数组 aaa 排序。 一般可以这么调用:gsort(a,1,n),把 a1∼na_{1\sim n}a1∼n 排好序。 int r[N]; void gsort(int *a,int x,int y){ if(x==y) return; int m 阅读全文
posted @ 2021-08-28 23:36
luckydrawbox
阅读(6)
评论(0)
推荐(0)
摘要:
对一个下标在 [l,r][l,r][l,r] 间的数组 aaa 排序。 一般可以这么调用:ksort(a,1,n),把 a1∼na_{1\sim n}a1∼n 排好序。 void ksort(int *a,int l,int r){ int i=l,j=r,f=a[(l+r)/2]; do{ wh 阅读全文
posted @ 2021-08-28 23:30
luckydrawbox
阅读(8)
评论(0)
推荐(0)
摘要:
#include<bits/stdc++.h> #define ll long long using namespace std; long long read(){ long long x=0,f=1;char ch=getchar(); while(!isdigit(ch)){if(ch=='- 阅读全文
posted @ 2021-08-28 23:17
luckydrawbox
阅读(9)
评论(0)
推荐(0)
摘要:
目录 常用程序模板 快读快写 离散化 重载运算符 文件输入输出 back 阅读全文
posted @ 2021-08-28 23:14
luckydrawbox
阅读(12)
评论(0)
推荐(0)
摘要:
这个还用说吗。 freopen("sth.in","r",stdin); freopen("sth.out","w",stdout); back 阅读全文
posted @ 2021-08-28 23:09
luckydrawbox
阅读(16)
评论(0)
推荐(0)
摘要:
把长度为 nnn 的 aaa 数组映射成只有 1∼tot1\sim tot1∼tot 的整数的 bbb 数组,其中返回值 tottottot 是 aaa 中元素个数。 int discrete(int n,int *a){ int b[N]; for(int i=1;i<=n;i++) b[i]=a 阅读全文
posted @ 2021-08-28 23:07
luckydrawbox
阅读(9)
评论(0)
推荐(0)

浙公网安备 33010602011771号