题解 | #整型数组合并#

整型数组合并

https://www.nowcoder.com/practice/c4f11ea2c886429faf91decfaf6a310b

set比较简单,自定义排序比较难
#include <bits/stdc++.h>
using namespace std;

int main() {
    int a, b;
    set<int> se;
    cin>>a;
    while(a--){
        int tmp; cin>>tmp;
        se.insert(tmp);
    }

    cin>>b;
    while(b--){
        int tmp; cin>>tmp;
        se.insert(tmp);
    }

    for(auto ss : se) cout<<ss;
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

DBsan:我也遇到过好的HR,全程友好交流。这年头基本的礼貌和尊重为什么好多HR都做不到
找工作时遇到的神仙HR
点赞 评论 收藏
分享
瑞雪兆丰年_:可以贴个超级大的校徽,以防HR眼拙
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务