题解 | 字符串哈希
字符串哈希
https://www.nowcoder.com/practice/dadbd37fee7c43f0ae407db11b16b4bf
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
int main() {
int N;
cin>>N;
unordered_map<string, int> mmap;
for(int i=0;i<N;i++){
string str;
cin>>str;
if(!mmap.count(str))
mmap[str]=i;
}
cout<<mmap.size();
}
// 64 位输出请用 printf("%lld")
拼多多集团-PDD成长空间 978人发布
查看7道真题和解析