没有合适的资源?快使用搜索试试~ 我知道了~
13子序列处理1
需积分: 0 0 下载量 49 浏览量
2022-08-08
20:11:58
上传
评论
收藏 13KB DOCX 举报
温馨提示
试读
2页
最大正字序列和#include <bits/stdc++.h>using namespace std;#define LL long longconst LL
资源详情
资源评论
资源推荐
最大正字序列和
#include <bits/stdc++.h>
using namespace std;
#define LL long long
const LL MAXN=5e4+10;
const LL INF=99999999;
struct Node
{
LL rk,val;
}node[MAXN];
LL a[MAXN];
//快排
LL quickSort(Node a[],LL low,LL high)
{
//low=0,high=len-1;
Node privot=a[low];
while(low<high)
{
while(low<high&&a[high].val>=privot.val)high--;
a[low]=a[high];
while(low<high&&a[low].val<=privot.val)low++;
a[high]=a[low];
}
a[low]=privot;
return low;
}
//递归快排
LL QSort(Node a[],LL low,LL high)
{
if(low<high)
{
LL tmp=quickSort(a,low,high);
QSort(a,low,tmp);
QSort(a,tmp+1,high);
}
}
void getMin(LL a[],LL len)
不知者无胃口
- 粉丝: 27
- 资源: 328
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0