#include <bits/stdc++.h>
using namespace std;
const int NMAX = 2e5;
const int LG = 18;
int N, M, Q;
int prm[NMAX + 5], v[NMAX + 5];
int nxt[NMAX + 5], lst[NMAX + 5], nxtpos[LG + 2][NMAX + 5];
int rgt[NMAX + 5];
int lg2[NMAX + 5];
int rmq[LG + 2][NMAX + 5];
int main() {
  scanf("%d%d%d", &N, &M, &Q);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &prm[i]);
    if (i > 1) nxt[prm[i - 1]] = prm[i];
  }
  nxt[prm[N]] = prm[1];
  for (int i = 1; i <= M; i++) scanf("%d", &v[i]);
  for (int i = 1; i <= N; i++) lst[i] = M + 1;
  nxtpos[0][M + 1] = M + 1;
  for (int i = M; i >= 1; i--) {
    nxtpos[0][i] = lst[nxt[v[i]]];
    lst[v[i]] = i;
  }
  for (int i = 1; (1 << i) <= N; i++)
    for (int j = 1; j <= M + 1; j++)
      nxtpos[i][j] = nxtpos[i - 1][nxtpos[i - 1][j]];
  for (int i = 1; i <= M; i++) {
    int pos = i;
    int rem = N - 1;
    for (int j = 0; (1 << j) <= rem; j++)
      if ((rem >> j) & 1) pos = nxtpos[j][pos];
    rgt[i] = pos;
    rmq[0][i] = rgt[i];
  }
  for (int i = 2; i <= M; i++) lg2[i] = lg2[i >> 1] + 1;
  for (int i = 1; (1 << i) <= M; i++)
    for (int j = 1; j + (1 << i) - 1 <= M; j++)
      rmq[i][j] = min(rmq[i - 1][j], rmq[i - 1][j + (1 << (i - 1))]);
  for (int q = 1; q <= Q; q++) {
    int st, dr;
    scanf("%d%d", &st, &dr);
    int lg = lg2[dr - st + 1];
    int pos = min(rmq[lg][st], rmq[lg][dr - (1 << lg) + 1]);
    printf("%d", (pos <= dr));
  }
  return 0;
}
