#include <bits/stdc++.h>
using namespace std;
const int maxn = 400010;
int n, m, q, p[maxn], lstcol[maxn], a[maxn], lstd[maxn], lg[maxn], f[maxn][20],
    st[maxn][20], l, r;
int rmq(int l, int r) {
  int k = lg[r - l + 1];
  return max(st[l][k], st[r - (1 << k) + 1][k]);
}
int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x * f;
}
int main() {
  n = read(), m = read(), q = read();
  for (int i = 1; i <= n; i++) p[i] = read();
  p[0] = p[n];
  for (int i = 1; i <= n; i++) lstcol[p[i]] = p[i - 1];
  for (int i = 1; i <= m; i++) a[i] = read();
  for (int i = 1; i <= m; i++) {
    f[i][0] = lstd[lstcol[a[i]]];
    lstd[a[i]] = i;
  }
  for (int i = 2; i <= max(n, m); i++) lg[i] = lg[i / 2] + 1;
  for (int i = 1; i <= lg[n]; i++)
    for (int j = 1; j <= m; j++) f[j][i] = f[f[j][i - 1]][i - 1];
  for (int i = 1; i <= m; i++) {
    st[i][0] = i;
    for (int j = 0; j <= lg[n - 1]; j++)
      if ((n - 1) & (1 << j)) st[i][0] = f[st[i][0]][j];
  }
  for (int i = 1; i <= lg[m]; i++)
    for (int j = 1; j + (1 << i) - 1 <= m; j++)
      st[j][i] = max(st[j][i - 1], st[j + (1 << (i - 1))][i - 1]);
  while (q--) {
    l = read(), r = read();
    if (rmq(l, r) >= l)
      printf("1");
    else
      printf("0");
  }
  printf("\n");
  return 0;
}
