umap求Hack
查看原帖
umap求Hack
743373
Vitamin_B楼主2024/5/19 15:04

rt,蒟蒻用umap水过(每个点的时间都是大约map的一半),但蒟蒻不会卡,所以求Hack

//# pragma GCC optimize("Ofast,no-stack-protector")
//
//# pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

# include <bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef unsigned long long ull;

typedef pair <int, int> pii;

int t, n, x;

unordered_map <int, bool> mp;

int main () {

	ios::sync_with_stdio (0);

	cin.tie (0);

	cout.tie (0);

	cin >> t;

	while (t --) {

		cin >> n;

		mp.clear ();

		while (n --) {

			cin >> x;

			if (! mp[x])
				mp[x] = 1, cout << x << ' ';

		}

		cout << '\n';

	}

	return 0;

}
2024/5/19 15:04
加载中...