func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     int n;     cin >> n;     map<int, vector<int> > pos;     map<int, int> result;     for (int i = 0; i < n; i++) {       int t;       cin >> t;       if (pos.find(t) == pos.end()) {         vector<int> temp;         temp.push_back(i + 1);         pos.insert(pair<int, vector<int> >(t, temp));       } else {         pos[t].push_back(i + 1);       }     }     for (map<int, vector<int> >::iterator iter = pos.begin(); iter != pos.end();          iter++) {       int len = iter->second.size();       if (len == 1) {         result.insert(pair<int, int>(iter->first, 0));         continue;       }       int count = 2;       int diff = iter->second[1] - iter->second[0];       for (int i = 1; i < len - 1; i++) {         if (diff != iter->second[i + 1] - iter->second[i]) break;         count++;       }       if (count == len) result.insert(pair<int, int>(iter->first, diff));     }     cout << result.size() << endl;     for (map<int, int>::iterator iter = result.begin(); iter != result.end();          iter++)       cout << iter->first <<     << iter->second << endl;     return 0;   }   