#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T& x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  x *= f;
}
template <typename T, typename... Args>
void read(T& x, Args&... args) {
  read(x), read(args...);
}
template <typename T>
void write(T x) {
  if (x < 0) putchar('-'), write(-x);
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
const int maxn = 202000;
int n, m, q, p[maxn], cyc[maxn], _x, go[maxn][20], last[maxn];
int R[maxn];
int query(int x, int y) {
  for (int i = 19; i >= 0; --i)
    if (y >> i & 1) x = go[x][i];
  return x;
}
int main() {
  read(n, m, q);
  for (int i = 1; i <= n; ++i) read(p[i]);
  p[0] = p[n];
  for (int i = 1; i <= n; ++i) last[p[i]] = p[i - 1];
  for (int i = 1; i <= m; ++i) {
    read(_x);
    R[_x] = i;
    go[i][0] = R[last[_x]];
    for (int j = 1; j < 20; ++j) go[i][j] = go[go[i][j - 1]][j - 1];
    cyc[i] = max(cyc[i - 1], query(i, n - 1));
  }
  while (q--) {
    int l, r;
    read(l, r);
    putchar((cyc[r] >= l) + '0');
  }
  return 0;
}
