首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
ryuki
2026年3月14日 22:11
字符串哈希 题解:sort让相同字符串相邻,然后遍历
P1603
回复 0
|
赞 5
|
浏览 130
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector<string> str(n); for(int i = 0; i < n; i++) cin >> str[i]; //排序让相同的字符串相邻 sort(str.begin(),st...
yauqq
2026年1月31日 15:45
字符串哈希 题解:
P1603
回复 0
|
赞 9
|
浏览 336
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; set<string> s; while(n--){ string str; cin>>str; s.insert(str); } cout<<s.size()<<endl; }
Ang
2020年3月20日 10:14
set
P1603
回复 0
|
赞 15
|
浏览 8.9k
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; set<string> s; while(n--){ string str; cin>>str; s.insert(str); } cout<<s.size()<<endl; }
题目
字符串哈希
题解数量
3
发布题解
在线答疑
热门题解
1
set
2
字符串哈希 题解:
3
字符串哈希 题解:sort让相同字符串相邻,然后遍历