func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 200007;   int n, m, q, p[N], a[N], apre[N], lst[N], ppre[N], fa[N], dep[N], w[N], b[N];   vector<int> G[N];   int max(int a, int b) { return a > b ? a : b; }   int min(int a, int b) { return a < b ? a : b; }   int read() {     int x;     scanf( %d , &x);     return x;   }   void dfs(int u) {     int i, v;     b[dep[u]] = u, w[u] = dep[u] >= n ? b[dep[u] - (n - 1)] : m + 1;     for (i = G[u].size() - 1; ~i; --i) v = G[u][i], dep[v] = dep[u] + 1, dfs(v);   }   int main() {     n = read(), m = read(), q = read();     int i, j;     for (i = 1; i <= n; ++i) p[i] = read();     p[0] = p[n];     for (i = 1; i <= n; ++i) ppre[p[i]] = p[i - 1];     for (i = 1; i <= m; ++i) {       a[i] = read(), apre[i] = lst[a[i]], lst[a[i]] = i;       for (j = lst[ppre[a[i]]]; j && !fa[j]; j = apre[j]) fa[j] = i;     }     for (i = 1; i <= m; ++i) fa[i] ? G[fa[i]].push_back(i) : G[0].push_back(i);     dfs(0);     for (i = m - 1; i; --i) w[i] = min(w[i + 1], w[i]);     while (q--) i = read(), j = read(), putchar(48 + (w[i] <= j));   }   