60分map,求助大佬

P4305 [JLOI2011] 不重复数字

@[acmwriter](/user/800751) 此题卡map,请将map改为unordered_map(话说你这代码是怎么编译通过的)
by A6n6d6y6 @ 2023-08-05 19:08:25


@[acmwriter](/user/800751) 还有,你这代码常数有亿点大,自己卡下常。
by A6n6d6y6 @ 2023-08-05 19:11:50


@[A6n6d6y6](/user/750329) 感谢大佬
by acmwriter @ 2023-08-05 19:14:22


@[A6n6d6y6](/user/750329) 为啥我用unordered_map编译要报错
by acmwriter @ 2023-08-05 19:29:36


```cpp #include<bits/stdc++.h> using namespace std; int main(){ map<int,int>mp; int n,s,m; scanf("%d",&n); while(n--){ scanf("%d",&m); mp.clear(); while(m--){ scanf("%d",&s); if(mp[s]!=1){ mp[s]=1; cout<<s<<" "; } } cout<<endl; } return 0; } ```6,输入改为scanf就水过了
by acmwriter @ 2023-08-05 20:45:08


@[acmwriter](/user/800751) unordered_map是C++11的东西。你的编译器版本太低了。
by A6n6d6y6 @ 2023-08-06 08:18:10


|