题解 | #有序序列合并#
有序序列合并
https://www.nowcoder.com/practice/a9e943b0dab142759807d0cfb6863897
#include<iostream> #include<bits/stdc++.h> using namespace std; int n, m, c, t[2006]; void ikun() { cin >> n >> m; for (int i = 1; i <= n + m; i++) cin >> t[i]; sort(t+1 ,t+1+n+m); for (int i = 1; i <= n + m; i++) cout << t[i] << " "; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); ikun(); return 0; }