unordered_map的find方法复杂度不是O(1)吗,我的代码也没有复杂度高的地方啊。为啥tle了呢
#include<iostream>
#include<unordered_set>
using namespace std;
int main() {
int n;
cin >> n;
while (n--) {
unordered_set<int> st;
int m;
cin >> m;
for (int i = 0; i < m; ++i) {
int temp;
cin >> temp;
if (st.find(temp) == st.end())
cout << temp << " ";
st.insert(temp);
}
cout << endl;
}
return 0;
}