#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    std::vector<int> first = {1, 3, 5, 7, 9};
    std::vector<int> second = {2, 4, 6, 8, 10};
    std::vector<int> merged(first.size() + second.size());

    // 使用 std::merge() 函数将两个已排序的向量合并为一个有序序列
    std::merge(first.begin(), first.end(), second.begin(), second.end(), merged.begin());

    // 输出合并后的有序序列
    std::cout << "Merged sequence: ";
    for (const auto& num : merged) {
        std::cout << num << " ";
    }
    std::cout << std::endl;

    return 0;
}
