#include <bits/stdc++.h>
int input() {
  int a = 0, s, d = 1;
  while (!isdigit(s = getchar()))
    if (s == '-') d *= -1;
  do a = a * 10 + s - '0';
  while (isdigit(s = getchar()));
  return a * d;
}
const int M = 200050;
int n, m, q, p[M], qw[M], rt[M], rb[M], we[M], as[M];
void D(int x, int z) {
  we[z] = x;
  as[x] = z >= n ? we[z - n + 1] : -1;
  for (int y = rt[x]; y; y = rb[y]) D(y, z + 1);
}
int main() {
  n = input();
  m = input();
  q = input();
  for (int i = 1; i <= n; ++i) p[input()] = i;
  for (int i = 1; i <= m; ++i) {
    int x = p[input()];
    int y = qw[x == 1 ? n : x - 1];
    rb[i] = rt[y];
    rt[y] = i;
    qw[x] = i;
  }
  D(0, 0);
  for (int i = 1; i <= m; ++i) as[i] = std::max(as[i], as[i - 1]);
  while (q--) {
    int l = input(), r = input();
    printf("%d", as[r] >= l);
  }
}
