func_code_string: #include <bits/stdc++.h>   using namespace std;   ifstream f( dima1.in );   ofstream g( dima1.out );   int n, a[200005], b[200005], b2[200005], k, ap[200005], ap2[200005], ok, m, p,       spos[200005], sol = 0;   vector<int> r[200005];   vector<int> ps[200005];   int Cbin(int x) {     int i, j, st = 1, dr = k, mid;     while (st < dr) {       mid = (st + dr) / 2;       if (x < b2[mid])         dr = mid - 1;       else if (x > b2[mid])         st = mid + 1;       else if (x == b2[mid])         return mid;     }     mid = (st + dr) / 2;     if (b2[mid] == x)       return mid;     else       return 0;   }   int main() {     int i, j, pos, ok;     cin >> n >> m >> p;     for (i = 1; i <= n; i++) cin >> a[i];     for (i = 1; i <= m; i++) cin >> b[i];     sort(b + 1, b + m + 1);     b2[1] = b[1];     k = 1;     ap[1] = 1;     for (i = 2; i <= m; i++) {       if (b[i] == b2[k])         ap[k]++;       else {         k++;         b2[k] = b[i];         ap[k] = 1;       }     }     for (i = 1; i <= n; i++) {       pos = Cbin(a[i]);       a[i] = pos;     }     for (i = 1; i <= n; i++) {       if (r[i % p].size() == 0) {         r[i % p].push_back(0);         ps[i % p].push_back(0);       }       r[i % p].push_back(a[i]);       ps[i % p].push_back(i);     }     for (i = 0; i < p; i++)       if ((r[i].size() - 1) >= m) {         ok = 0;         for (j = 1; j < r[i].size(); j++) {           if (r[i][j] != 0) {             if (ap2[r[i][j]] == ap[r[i][j]])               ok--;             else if (ap2[r[i][j]] + 1 == ap[r[i][j]])               ok++;             ap2[r[i][j]]++;           }           if (j > m) {             if (r[i][j - m] != 0) {               if (ap2[r[i][j - m]] == ap[r[i][j - m]])                 ok--;               else if (ap2[r[i][j - m]] - 1 == ap[r[i][j - m]])                 ok++;               ap2[r[i][j - m]]--;             }           }           if (j >= m && ok == k) {             sol++;             spos[sol] = ps[i][j - m + 1];           }         }         for (j = r[i].size() - 1; j >= 1; j--) ap2[r[i][j]] = 0;       }     sort(spos + 1, spos + sol + 1);     cout << sol <<   n ;     for (i = 1; i <= sol; i++) cout << spos[i] <<    ;     return 0;   }   