# C++每日一题 Day 9 璃月七星选举

***

lhy版权所有，禁止转载

### 知识点：快速排序

***

## 题目描述

众所周知，璃月是一个人民民主专政的资本主义国家。因为天叔当众叫甘雨姐姐导致其被暗杀，所以现在璃月正在全民投票选举出一位新的璃月七星。

现在给出所有的提名人和其获得的票数。但是由于璃月想获取政治权利的资本家太多了，凝光希望能在`nlogn`的复杂度之内结束计算，取得一份提名人及其票数的排行榜。听说你这个旅行者数学知识渊博，请你设计一个算法，比冒泡排序等简单排序更快地完成七星继承人的计算吧。

## 输入

第一行为一个整数n，表示参选的人的总数

第二行为n个字符串，用空格间隔，表示他们的名字

第三行为n个整数，用空格间隔，表示他们的选票数（由于璃月人都跑去轻策庄养老了，所以选票不多于2000张）

## 输出

第一行为n个字符串，第二行为n个整数，为排序好的选票排行榜（名字与选票要对应）

## 输入输出样例

输入

```java
4
香菱 胡桃 达达利亚 荧 
200 100 0 1000
```

输出

```java
荧 香菱 胡桃 达达利亚
1000 200 100 0
```

***

## 回答要求

* 使用快速排序算法解决问题。
* 其实C++自带的stl中有一个写好的sort()快排轮子可以秒杀本题（傻了吧），可以试试看使用这个sort()函数。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.mcyou.cc/c++-mei-ri-yi-ti/c++-mei-ri-yi-ti-day-9-li-yue-qi-xing-xuan-ju.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
