#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 3;
int n, m, q, li, ri;
int v[maxn];
int perm[maxn], sig[maxn];
int fa[maxn][23];
int lastap[maxn];
int termino[maxn];
int st[4 * maxn];
void build(int nodo, int l, int r) {
  if (l == r) {
    st[nodo] = termino[l];
    return;
  }
  int md = (l + r) / 2;
  build(2 * nodo + 1, l, md);
  build(2 * nodo + 2, md + 1, r);
  st[nodo] = min(st[2 * nodo + 1], st[2 * nodo + 2]);
  return;
}
int get(int nodo, int l, int r, int sq, int eq) {
  if (l > eq || r < sq) return INT_MAX;
  if (l >= sq && r <= eq) return st[nodo];
  int md = (l + r) / 2;
  return min(get(2 * nodo + 1, l, md, sq, eq),
             get(2 * nodo + 2, md + 1, r, sq, eq));
}
int main() {
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &perm[i]);
    sig[perm[i - 1]] = perm[i];
    lastap[i] = m + 1;
  }
  sig[perm[n]] = perm[1];
  for (int i = 1; i <= m + 1; i++) {
    if (i != m + 1) scanf("%d", &v[i]);
    for (int j = 0; j <= 20; j++) fa[i][j] = m + 1;
  }
  for (int i = m; i >= 1; i--) {
    fa[i][0] = lastap[sig[v[i]]];
    for (int j = 1; j <= 20; j++) fa[i][j] = fa[fa[i][j - 1]][j - 1];
    lastap[v[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    int dist = n - 1;
    int cur = i;
    for (int j = 20; j >= 0; j--) {
      if (dist >= (1 << j)) {
        cur = fa[cur][j];
        dist -= (1 << j);
      }
    }
    termino[i] = cur;
  }
  build(0, 1, m);
  while (q--) {
    scanf("%d %d", &li, &ri);
    if (get(0, 1, m, li, ri) <= ri)
      printf("1");
    else
      printf("0");
  }
  return 0;
}
