Files
2026-10-06 22:27:55 +08:00

39 lines
654 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# P1631 序列合并
## 题目描述
有两个长度为 $N$ 的**单调不降**序列 $A,B$,在 $A,B$ 中各取一个数相加可以得到 $N^2$ 个和,求这 $N^2$ 个和中最小的 $N$ 个。
## 输入格式
第一行一个正整数 $N$;
第二行 $N$ 个整数 $A_{1\dots N}$。
第三行 $N$ 个整数 $B_{1\dots N}$。
## 输出格式
一行 $N$ 个整数,从小到大表示这 $N$ 个最小的和。
## 输入输出样例 #1
### 输入 #1
```
3
2 6 6
1 4 8
```
### 输出 #1
```
3 6 7
```
## 说明/提示
对于 $50\%$ 的数据,$N \le 10^3$。
对于 $100\%$ 的数据,$1 \le N \le 10^5$,$1 \le A_i,B_i \le 10^9$。