G. [GESP]L5-202312-Q2033-S
[GESP]L5-202312-Q2033-S
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
下面的 C++ 代码实现对 list 的快速排序,有关说法,错误的是( )。
vector<int> operator + (vector<int> lA, vector<int> lB)
{
vector<int> lst;
for (int i = 1; i < lA.size(); i++)
lst.push_back(lA[i]);
for (int i = 1; i < lB.size(); i++)
lst.push_back(lB[i]);
return lst;
}
vector<int> qSort(vector<int> lst)
{
if (lst.size() < 2)
return lst;
int pivot = lst[0];
vector<int> less, greater;
for (int i = 1; i < lst.size(); i++)
if (lst[i] <= pivot) less.push_back(lst[i]);
else greater.push_back(lst[i]);
for (int i = 1; i < lst.size(); i++)
if (lst[i] <= pivot) less.push_back(lst[i]);
else greater.push_back(lst[i]);
return _________________________;
}
{{ select(1) }}
qSort(less) + qSort(greater) + (vector<int>)pivot(vector<int>)pivot + (qSort(less) + qSort(greater))(qSort(less) + (vector<int>)pivot + qSort(greater))qSort(less) + pivot + qSort(greater)
GESP 2023.12 C++ 五级 全真模拟赛
- 状态
- 已结束
- 规则
- OI
- 题目
- 27
- 开始于
- 2026-11-20 13:29
- 结束于
- 2026-11-25 13:29
- 持续时间
- 2 小时
- 主持人
- 参赛人数
- 0