#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  vector<int> inv(n);
  for (int i = 0; i < n; i++) {
    int p;
    scanf("%d", &p);
    inv[p - 1] = i;
  }
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &a[i]);
    a[i] = inv[a[i] - 1];
  }
  vector<int> occ(n, -1);
  vector<vector<int>> pnex(20, vector<int>(m, -1));
  for (int i = m - 1; i >= 0; --i) {
    pnex[0][i] = occ[(a[i] + 1) % n];
    occ[a[i]] = i;
  }
  for (int i = 1; i < 20; ++i) {
    for (int j = 0; j < m; j++) {
      if (pnex[i - 1][j] == -1)
        pnex[i][j] = -1;
      else
        pnex[i][j] = pnex[i - 1][pnex[i - 1][j]];
    }
  }
  vector<bool> seen(m);
  vector<int> k(m, m + 1);
  vector<int> best(m, 0);
  for (int i = 0; i < m; i++) {
    int r = i;
    int q = n - 1;
    int j = 0;
    while (q != 0) {
      if (q % 2 != 0) {
        if (r != -1) r = pnex[j][r];
      }
      ++j;
      q /= 2;
    }
    if (r != -1) k[i] = r;
  }
  for (int i = m - 2; i >= 0; --i) {
    k[i] = min(k[i], k[i + 1]);
  }
  for (int _ = 0; _ < q; _++) {
    int u, v;
    scanf("%d%d", &u, &v);
    --u;
    --v;
    if (k[u] <= v)
      printf("1");
    else
      printf("0");
  }
  printf("\n");
}
