func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 222222;   unsigned long long p4423[maxn];   struct State {     unsigned long long hashValue;     int count;     void assign(int value) {       if (value == 0) {         hashValue = 0;         count = 0;       } else {         hashValue = value;         count = 1;       }     }     void assign(const State &l, const State &r) {       hashValue = p4423[r.count] * l.hashValue + r.hashValue;       count = l.count + r.count;     }   };   State states[maxn * 2];   int n, m;   int a[maxn], b[maxn];   int pos[maxn];   void update(int l, int r, int p, int v) {     if (l == r) {       if (p == l) {         states[(((l) + (r)) | ((l) != (r)))].assign(v);       }       return;     }     int m = l + r >> 1;     if (p <= m) {       update(l, m, p, v);     }     if (p > m) {       update(m + 1, r, p, v);     }     states[(((l) + (r)) | ((l) != (r)))].assign(         states[(((l) + (m)) | ((l) != (m)))],         states[(((m + 1) + (r)) | ((m + 1) != (r)))]);   }   int main() {     p4423[0] = 1;     for (int i = 1; i < maxn; i++) {       p4423[i] = p4423[i - 1] * 4423;     }     scanf( %d%d , &n, &m);     unsigned long long targetHash = 0, ones = 0;     for (int i = 0; i < n; i++) {       scanf( %d , a + i);       targetHash = targetHash * 4423 + a[i];       ones = ones * 4423 + 1;     }     for (int i = 0; i < m; i++) {       scanf( %d , b + i);       pos[b[i]] = i;     }     for (int i = 1; i < n; i++) {       update(0, m - 1, pos[i], i);     }     int ret = 0;     for (int i = n; i <= m; i++) {       update(0, m - 1, pos[i], i);       assert(states[(((0) + (m - 1)) | ((0) != (m - 1)))].count == n);       if (states[(((0) + (m - 1)) | ((0) != (m - 1)))].hashValue == targetHash) {         ret++;       }       targetHash += ones;       update(0, m - 1, pos[i - n + 1], 0);     }     printf( %d n , ret);   }   