26 solutions
-
1
umap秒了:#include<bits/stdc++.h> #define ll long long using namespace std; ll n, ans = 0; unordered_map<string, bool> Map; int main() { ios::sync_with_stdio(false); cin.tie(0), cout.tie(0); cin >> n; for(int i = 1; i <= n; i++) { string s; cin >> s; if(!Map[s]) Map[s] = true, ans++; else continue; } cout << ans << endl; return 0; }
Information
- ID
- 180
- Time
- 300~1000ms
- Memory
- 1024MiB
- Difficulty
- 3
- Tags
- # Submissions
- 4245
- Accepted
- 572
- Uploaded By