#include <bits/stdc++.h>
int main() {
  int nP, nA, nQ;
  scanf("%d %d %d", &nP, &nA, &nQ);
  std::vector<int> perm(nP);
  for (int& item : perm) {
    scanf("%d", &item);
  }
  std::vector<int> src(nA);
  for (int& item : src) {
    scanf("%d", &item);
  }
  const int MAX_POW = 30;
  std::vector<std::vector<int>> nextOnPow(MAX_POW + 1,
                                          std::vector<int>(nA, -1));
  std::vector<int> permPos(nP + 1, -1);
  std::vector<int> srcPos(nP + 1, -1);
  for (int i = 0; i < nP; ++i) {
    permPos[perm[i]] = i;
  }
  for (int i = nA - 1; i >= 0; --i) {
    nextOnPow[0][i] = srcPos[perm[(permPos[src[i]] + 1) % nP]];
    srcPos[src[i]] = i;
  }
  std::vector<int> bestEnd(nA, nA + 1);
  int nSkip = nP - 1;
  for (int i = nA - 1; i >= 0; --i) {
    if (nextOnPow[0][i] != -1) {
      for (int pow = 1; pow <= MAX_POW; ++pow) {
        int curNext = nextOnPow[pow - 1][nextOnPow[pow - 1][i]];
        if (curNext == -1) {
          break;
        }
        nextOnPow[pow][i] = curNext;
      }
    }
    int pos = i;
    for (int j = 0; j <= MAX_POW; ++j) {
      if (nSkip & (1 << j)) {
        pos = nextOnPow[j][pos];
        if (pos == -1) {
          break;
        }
      }
    }
    if (pos != -1 && src[pos] == perm[(permPos[src[i]] + nP - 1) % nP]) {
      bestEnd[i] = pos;
    }
  }
  for (int i = nA - 2; i >= 0; --i) {
    bestEnd[i] = std::min(bestEnd[i], bestEnd[i + 1]);
  }
  for (int iQ = 0; iQ < nQ; ++iQ) {
    int left, right;
    scanf("%d %d", &left, &right);
    left -= 1;
    right -= 1;
    if (bestEnd[left] <= right) {
      printf("1");
    } else {
      printf("0");
    }
  }
  printf("\n");
  return 0;
}
