Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <cstdio>
- #include <vector>
- #include <iostream>
- #include <algorithm>
- #include <unordered_map>
- using namespace std;
- int main() {
- vector<string> strs;
- unordered_map<string, int> counter;
- int n;
- string word;
- cin >> n;
- for(int i = 0; i < n; i++){
- cin >> word;
- strs.push_back(word);
- counter[word]++;
- }
- for(string i : strs){
- cout << counter[i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment