Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <iomanip>
- #include <string>
- #include <algorithm>
- #include <set>
- #include <list>
- #include <sstream>
- #include <vector>
- #include <map>
- #include <stdlib.h>
- using namespace std;
- ifstream in("input.txt");
- ofstream out("output.txt");
- int main() {
- map <string, string> m;
- string x, y;
- int n; cin >> n;
- for (int i = 0; i < n; i++) {
- cin >> x;
- if (m.find(x) == m.end()) {
- m[x] = "OK";
- }
- else {
- y = x + to_string(m.count(x));
- auto it = m.end();
- m[y] = x + to_string(m.count(x));
- }
- }
- for (auto x : m) {
- cout << x.first << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement