#include <bits/stdc++.h>
using namespace std;
template <typename T>
void r1(T &x) {
  x = 0;
  char c(getchar());
  int f(1);
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -1;
  for (; '0' <= c && c <= '9'; c = getchar()) x = (x * 10) + (c ^ 48);
  x *= f;
}
const int maxn = 2e5 + 5;
const int maxm = maxn << 1;
const int mod = 1e9 + 7;
typedef int room[maxn];
template <int mod>
struct typemod {
  int z;
  typemod(int a = 0) : z(a) {}
  inline int inc(int a, int b) const {
    return a += b - mod, a + ((a >> 31) & mod);
  }
  inline int dec(int a, int b) const { return a -= b, a + ((a >> 31) & mod); }
  inline int mul(int a, int b) const { return 1ll * a * b % mod; }
  typemod<mod> operator+(const typemod<mod> &x) const {
    return typemod(inc(z, x.z));
  }
  typemod<mod> operator-(const typemod<mod> &x) const {
    return typemod(dec(z, x.z));
  }
  typemod<mod> operator*(const typemod<mod> &x) const {
    return typemod(mul(z, x.z));
  }
  typemod<mod> &operator+=(const typemod<mod> &x) {
    *this = *this + x;
    return *this;
  }
  typemod<mod> &operator-=(const typemod<mod> &x) {
    *this = *this - x;
    return *this;
  }
  typemod<mod> &operator*=(const typemod<mod> &x) {
    *this = *this * x;
    return *this;
  }
  int operator==(const typemod<mod> &x) const { return x.z == z; }
  int operator!=(const typemod<mod> &x) const { return x.z != z; }
};
int n, m, q, cnt;
room bef, p, a, near, pre, E, head;
struct Edge {
  int to, next;
} edg[maxn << 1];
void add(int u, int v) { edg[++cnt] = (Edge){v, head[u]}, head[u] = cnt; }
room dep, num, r;
void dfs(int p) {
  num[dep[p]] = p;
  if (dep[p] >= n)
    r[p] = num[dep[p] - (n - 1)];
  else
    r[p] = m + 1;
  for (int i = head[p]; i; i = edg[i].next) {
    int to = edg[i].to;
    dep[to] = dep[p] + 1;
    dfs(to);
  }
}
signed main() {
  int i, j;
  r1(n), r1(m), r1(q);
  for (i = 1; i <= n; ++i) {
    r1(p[i]), bef[p[i]] = p[i - 1];
  }
  bef[p[1]] = p[n];
  for (i = 1; i <= m; ++i) {
    r1(a[i]), pre[i] = near[a[i]], near[a[i]] = i;
    for (j = near[bef[a[i]]]; (j) && (E[j] == 0); j = pre[j]) E[j] = i;
  }
  for (i = 1; i <= m; ++i) add((E[i] == 0 ? m + 1 : E[i]), i);
  dfs(m + 1);
  for (i = m; i > 1; --i) r[i - 1] = min(r[i - 1], r[i]);
  while (q--) {
    int l, r;
    r1(l), r1(r);
    putchar('0' + (bool)(::r[l] <= r));
  }
  return 0;
}
