58

7天前
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


# include[HTML_REMOVED]

using namespace std;
const int N=100000;
int q[N];
int tmp[2*N];
int n;
void merge_sort(int q[], int l, int r)
{
if (l >= r) return;

int mid = l + r >> 1;
merge_sort(q, l, mid);
merge_sort(q, mid + 1, r);

int k = 0, i = l, j = mid + 1;
while (i <= mid && j <= r)
if (q[i] <= q[j]) tmp[k ++ ] = q[i ++ ];
else tmp[k ++ ] = q[j ++ ];

while (i <= mid) tmp[k ++ ] = q[i ++ ];
while (j <= r) tmp[k ++ ] = q[j ++ ];

for (i = l, j = 0; i <= r; i ++, j ++ ) q[i] = tmp[j];


}

int main()
{
scanf(“%d”,&n);
for(int i=0;i<n;i) scanf(“%d”,&q[i]);
merge_sort(q,0,n-1);
for(int i=0;i<n;i
) printf(“%d “,q[i]);
return 0;
}

7天前
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


# include[HTML_REMOVED]

using namespace std;
const int N=1e6+10;
int q[N];
int n;
int y;
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[HTML_REMOVED]x);
if(i<j) swap(q[i],q[j]);
}
quick_sort(q, l, j);
quick_sort(q, j + 1, r);
}
int main()
{
scanf(“%d”,&n);
scanf(“%d”,&y);
for(int i=0;i<n;i) scanf(“%d”,&q[i]);
quick_sort(q,0,n-1);
for(int i=0;i<n;i
)
{
if((i+1)==y) cout<<q[i];
}
return 0;
}

7天前

### 题目描述

blablabla

#### 样例

blablabla


### 算法1

blablabla

#### C++ 代码

blablabla


### 算法2

blablabla

#### C++ 代码

blablabla


# include[HTML_REMOVED]

using namespace std;
const int N=1e6+10;
int q[N];
int n;
int y;
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[HTML_REMOVED]x);
if(i<j) swap(q[i],q[j]);
}
quick_sort(q, l, j);
quick_sort(q, j + 1, r);
}
int main()
{
scanf(“%d”,&n);
scanf(“%d”,&y);
for(int i=0;i<n;i) scanf(“%d”,&q[i]);
quick_sort(q,0,n-1);
for(int i=0;i<n;i
)
{
if((i+1)==y) cout<<q[i];
}
return 0;
}

7天前
//这里填你的代码^^
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


# include[HTML_REMOVED]

using namespace std;
const int N=1e6+10;
int q[N];
int 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[HTML_REMOVED]x);
if(i<j) swap(q[i],q[j]);
}
quick_sort(q, l, j);
quick_sort(q, j + 1, r);
}
int main()
{
scanf(“%d”,&n);
for(int i=0;i<n;i) scanf(“%d”,&q[i]);
quick_sort(q,0,n-1);
for(int i=0;i<n;i
) printf(“%d “,q[i]);
return 0;
}