#include <bits/stdc++.h>
using namespace std;
int N, M, Q;
int arr[200005];
int p[200005];
int neto[200005];
int lastseen[200005];
int pad[200005][21];
int answer[200005];
struct st {
  int val;
  st *l, *r;
};
st* root;
st* build(int i, int j) {
  st* n = new st();
  if (i == j) {
    n->val = answer[i];
    return n;
  }
  int mid = (i + j) / 2;
  n->l = build(i, mid);
  n->r = build(mid + 1, j);
  n->val = min(n->l->val, n->r->val);
  return n;
}
int query(st* cur, int i, int j, int x, int y) {
  if (j < x || y < i) return M;
  if (x <= i && j <= y) return cur->val;
  int mid = (i + j) / 2;
  return min(query(cur->l, i, mid, x, y), query(cur->r, 1 + mid, j, x, y));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> M >> Q;
  int x;
  for (int i = 0; i < N; i++) {
    cin >> p[i];
    lastseen[i + 1] = M;
  }
  for (int i = 0; i < 21; i++) pad[M][i] = M;
  for (int i = 0; i < M; i++) {
    cin >> arr[i];
  }
  neto[p[N - 1]] = p[0];
  for (int i = 1; i < N; i++) {
    neto[p[i - 1]] = p[i];
  }
  int s, c;
  for (int i = M - 1; i >= 0; i--) {
    lastseen[arr[i]] = i;
    pad[i][0] = lastseen[neto[arr[i]]];
    for (int j = 1; j < 21; j++) pad[i][j] = pad[pad[i][j - 1]][j - 1];
    s = 0;
    c = i;
    for (int j = 20; j >= 0; j--) {
      if (s + (1 << j) < N) {
        c = pad[c][j];
        s += 1 << j;
      }
    }
    answer[i] = c;
    if (N == 1) answer[i] = M;
    if (N == 1 && p[0] == arr[i]) answer[i] = i;
  }
  root = build(0, M - 1);
  int i, j;
  while (Q--) {
    cin >> i >> j;
    i--;
    j--;
    cout << (query(root, 0, M - 1, i, j) <= j ? 1 : 0);
  }
  return 0;
}
