#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 15;
const int M = 18;
int in[N];
int lastInd[N], len[N];
int per[N], perInd[N];
int jump[N][M];
int minDist[N];
int seg[N * 4];
void init(int pos, int l, int r) {
  if (l == r) {
    seg[pos] = minDist[l];
    return;
  }
  int mid = (l + r) / 2;
  init(pos * 2, l, mid);
  init(pos * 2 + 1, mid + 1, r);
  seg[pos] = min(seg[pos * 2], seg[pos * 2 + 1]);
}
int query(int pos, int l, int r, int ql, int qr) {
  if (r < ql || qr < l) {
    return 1e9;
  }
  if (ql <= l && r <= qr) {
    return seg[pos];
  }
  int mid = (l + r) / 2;
  return min(query(pos * 2, l, mid, ql, qr),
             query(pos * 2 + 1, mid + 1, r, ql, qr));
}
void solve() {
  int n, m, q;
  scanf("%d %d %d", &n, &m, &q);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &per[i]);
    perInd[per[i]] = i;
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &in[i]);
  }
  memset(lastInd, -1, sizeof(lastInd));
  for (int i = m; i >= 1; --i) {
    minDist[i] = 1e9;
    int curPerInd = perInd[in[i]];
    int nextInd = curPerInd + 1;
    if (nextInd > n) {
      nextInd -= n;
    }
    nextInd = lastInd[per[nextInd]];
    if (nextInd == -1) {
      len[i] = 1;
    } else {
      len[i] = min(n, len[nextInd] + 1);
      jump[i][0] = nextInd;
      for (int j = 1; j < M; ++j) {
        jump[i][j] = jump[jump[i][j - 1]][j - 1];
      }
    }
    if (len[i] == n) {
      int cur = i, d = n - 1;
      for (int j = 0; j < M; ++j) {
        if (d & (1 << j)) {
          cur = jump[cur][j];
        }
      }
      minDist[i] = cur;
    }
    lastInd[in[i]] = i;
  }
  init(1, 1, m);
  for (int i = 0; i < q; ++i) {
    int l, r;
    scanf("%d %d", &l, &r);
    int q = query(1, 1, m, l, r);
    if (q <= r) {
      printf("1");
    } else {
      printf("0");
    }
  }
  cout << endl;
}
int main() { solve(); }
