#include <bits/stdc++.h>
using namespace std;
const long long Linf = 0x7f7f7f7f7f7f7f7f;
const int Inf = 0x3f3f3f3f;
char buf[100000], *p1 = buf, *p2 = buf;
const int MAXN = 2e5 + 10;
inline char nc() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  int w = 1, data = 0;
  char ch = 0;
  while (ch != '-' && (ch < '0' || ch > '9')) ch = nc();
  if (ch == '-') w = -1, ch = nc();
  while (ch >= '0' && ch <= '9') data = data * 10 + ch - '0', ch = nc();
  return w * data;
}
int n, m, q, que[MAXN];
int fa[MAXN][20], a[MAXN], b[MAXN], id[MAXN], lst[MAXN];
int query(int x) {
  for (int i = 25; i >= 0; i--)
    if ((n - 1) & (1 << i)) x = fa[x][i];
  return x;
}
int main() {
  n = read(), m = read(), q = read();
  for (int i = 1; i <= n; i++) a[i] = read(), id[a[i]] = i;
  a[0] = a[n];
  memset(que, 0x3f, sizeof que);
  for (int i = 1; i <= m; i++) {
    b[i] = read();
    if (id[b[i]] == 1)
      fa[i][0] = lst[n];
    else
      fa[i][0] = lst[id[b[i]] - 1];
    lst[id[b[i]]] = i;
  }
  int lg = log(max(n, m)) / log(2) + 1;
  for (int j = 1; j <= lg; j++)
    for (int i = 1; i <= m; i++) fa[i][j] = fa[fa[i][j - 1]][j - 1];
  for (int i = m, l; i >= 1; i--) {
    l = query(i);
    if (l == 0) continue;
    que[l] = min(que[l], i);
  }
  for (int i = m, r = Inf; i >= 1; i--)
    r = min(r, que[i]), que[i] = min(que[i], r);
  for (int i = 1; i <= q; i++) {
    int l = read(), r = read();
    if (que[l] <= r)
      cout << '1';
    else
      cout << '0';
  }
  return 0;
}
