@[0x00AC3375](/user/855093)
你觉得你是自觉就是自觉
by xvl_ @ 2023-07-26 23:06:23
你的代码跟 hash 根本没有一点关系
by xvl_ @ 2023-07-26 23:07:12
确实不太懂为啥要拿这个当模板,好比拿个 a+b
by An_Aholic @ 2023-07-26 23:51:39
当网络流模板然后说让你自觉一样
by An_Aholic @ 2023-07-26 23:51:55
https://www.luogu.com.cn/record/117606723
https://www.luogu.com.cn/record/117609233
提交记录里面不少人使用了map
用Python3的话更短
by 0x00AC3375 @ 2023-07-27 08:22:23
@[SKB_Konnyaku](/user/792031) 比如说保证两个数和计算结果都在int64范围内然后叫“模板 高精度加法”
by 0x00AC3375 @ 2023-07-27 08:23:11
我竟然没意识到这题可以用map,看来我map没好好学(
by 宇宙少年 @ 2023-08-03 17:42:07
## unordered_map不好吗???
##### 16行搞定
### (自信) :
```cpp
#include <bits/stdc++.h>
using namespace std;
unordered_map<string,bool> u;
int main()
{
int q,x=0;
cin>>q;
u.clear();
for(int k=1;k<=q;k++)
{
string w;
cin>>w;
if(u[w]==0)x++,u[w]=1;
}
cout<<x;
}
```
by simonzzq @ 2023-08-06 19:42:09
还是stl的unique好
```cpp
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n;
cin>>n;
string a[100000];
for(int i=0;i<n;i++)cin>>a[i];
sort(a,a+n);
string* m=unique(a,a+n);
cout<<m-a;
}
```
by XSJProgrammer @ 2023-08-12 08:56:21
@[XSJProgrammer](/user/484719) 思路清奇。
by WsW_ @ 2023-08-15 11:00:46