题解 | #B-凌波微步#

B-凌波微步

https://ac.nowcoder.com/acm/problem/14542

set容器符合题意 set容器特点 自动排序 删除重复

#include <iostream>
using namespace std;
#include <set>

void solve()
{
    int x;
    cin >> x;
    set<int> s;
    for(int j=0;j<x;j++)
    {
        int m;
        cin >> m;
        s.insert(m);
    }
    cout << s.size() << endl;
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int T=1;
    cin >> T;
    while(T--)
        solve();
}

全部评论

相关推荐

对空六翼:你真幸运,碰见这么好的人,不像我,秋招的时候被室友骗进cx了
实习好累,可以辞职全力准...
点赞 评论 收藏
分享
03-14 16:04
已编辑
安徽农业大学 算法工程师
痴心的她allin秋...:啥笔试都挂怎么办,某9本考研下岸,练也没时间了,对算法也不感兴趣,大部分大厂笔试只能A0-1个😄
米哈游笔试
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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