Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- #include <vector>
- using namespace std;
- int main() {
- map<vector<string>, int> m;
- int q;
- cin >> q;
- for (int i = 0; i < q; i++) {
- int n;
- cin >> n;
- vector<string> v;
- for (int j = 0; j < n; j++) {
- string stop;
- cin >> stop;
- v.push_back(stop);
- }
- if (m.count(v)) {
- cout << "Already exists for " << m[v] << endl;
- }
- else {
- int temp = m.size() + 1;
- m[v] = temp;
- cout << "New bus " << m[v] << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement