60分求助,4个TLE
查看原帖
60分求助,4个TLE
319478
zhibuba楼主2020/8/13 19:24
#include <unordered_set>
#include <iostream>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    int T;
    cin >> T;
    while (T--)
    {
        int n, a;
        unordered_set<int> S;
        cin >> n;
        while (n--)
        {
            cin >> a;
            if (!S.count(a))
            {
                cout << a << ' ';
                S.insert(a);
            }
        }
        cout << '\n';
    }
    return 0;
}
2020/8/13 19:24
加载中...