#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
inline int read() {
  register int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return (f == 1) ? x : -x;
}
int n, m, q;
int f[N][21], st[N][21];
int a[N], p[N], pre[N], rk[N];
int getmax(int l, int r) {
  int k = log2(r - l + 1);
  return max(st[l][k], st[r - (1 << k) + 1][k]);
}
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++) pre[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] = rk[pre[a[i]]];
    rk[a[i]] = i;
  }
  for (int i = 1; i <= 20; 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 <= 20; j++) {
      if ((n - 1) >> j & 1) {
        st[i][0] = f[st[i][0]][j];
      }
    }
  }
  for (int i = 1; i <= 20; 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--) {
    int l = read(), r = read();
    if (getmax(l, r) >= l) {
      printf("1");
    } else {
      printf("0");
    }
  }
  puts("");
}
