#include <bits/stdc++.h>
using namespace std;
void file(bool opt) {
  if (opt && fopen("in.txt", "r"))
    freopen("in.txt", "r", stdin), freopen("out.txt", "w", stdout);
}
int n, m, q;
int a[200000 + 5];
int b[200000 + 5];
int nxt[200000 + 5];
int pos[200000 + 5];
int tz[20][200000 + 5];
int pr[200000 + 5];
vector<pair<int, int>> que;
bool cmp(pair<int, int> a, pair<int, int> b) { return a.second < b.second; }
int main() {
  file(1);
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) nxt[a[i]] = a[(i + 1) % n];
  memset(pos, 0, sizeof pos);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
  for (int i = m; i >= 1; i--) {
    pos[b[i]] = i;
    tz[0][i] = pos[nxt[b[i]]];
  }
  for (int i = 1; i <= 20; i++) {
    for (int j = 1; j <= m; j++) {
      tz[i][j] = tz[i - 1][tz[i - 1][j]];
    }
  }
  for (int i = 1; i <= m; i++) {
    int p = i;
    for (int j = 0; j < 20; j++) {
      if ((n - 1) & (1ll << j)) {
        p = tz[j][p];
      }
    }
    if (p == 0)
      pr[i] = -1;
    else
      pr[i] = p;
  }
  int box = 0x3f3f3f3f;
  for (int i = m; i >= 1; i--) {
    if (pr[i] == -1)
      pr[i] = box;
    else {
      box = min(box, pr[i]);
      pr[i] = box;
    }
  }
  while (q--) {
    int l, r;
    scanf("%d%d", &l, &r);
    bool flag = 0;
    if (pr[l] != 0x3f3f3f3f && r >= pr[l]) flag = 1;
    printf("%d", flag);
  }
  printf("\n");
  return 0;
}
