#include <bits/stdc++.h>
using u64 = unsigned long long;
template <class T>
std::vector<T> read(int n) {
  std::vector<T> res(n);
  for (auto& r : res) {
    std::cin >> r;
  }
  return res;
}
int lg_floor(u64 n) { return 63 - __builtin_clzll(n); }
int lg_ceil(u64 n) { return 63 - __builtin_clzll(2 * n - 1); }
template <class T>
struct RMQ {
  RMQ(const std::vector<T>& AA)
      : A(AA), M(lg_ceil(A.size() + 1), std::vector<int>(A.size())) {
    std::iota(begin(M[0]), end(M[0]), 0);
    for (size_t i = 0; i + 1 < M.size(); i++) {
      for (size_t j = 0; j + (1 << i) < M[i].size(); j++) {
        if (A[M[i][j]] < A[M[i][j + (1 << i)]]) {
          M[i + 1][j] = M[i][j];
        } else {
          M[i + 1][j] = M[i][j + (1 << i)];
        }
      }
    }
  }
  int operator()(int l, int r) {
    int k = lg_floor(r - l);
    if (A[M[k][l]] < A[M[k][r - (1 << k)]]) {
      return M[k][l];
    } else {
      return M[k][r - (1 << k)];
    }
  }
  std::vector<T> A;
  std::vector<std::vector<int>> M;
};
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
  int n, m, q;
  std::cin >> n >> m >> q;
  auto p = read<int>(n);
  auto a = read<int>(m);
  for (int& v : p) v--;
  for (int& v : a) v--;
  std::vector<int> follow(n);
  for (int i = 0; i < n; i++) {
    follow[p[i]] = p[(i + 1) % n];
  }
  const int lg = lg_floor(n) + 1;
  std::vector<std::vector<int>> jump(lg, std::vector<int>(m + 1, m));
  std::vector<int> next(n, m);
  for (int i = m - 1; i >= 0; i--) {
    jump[0][i] = next[follow[a[i]]];
    next[a[i]] = i;
  }
  for (int j = 1; j < lg; j++) {
    for (int i = 0; i < m; i++) {
      jump[j][i] = jump[j - 1][jump[j - 1][i]];
    }
  }
  std::vector<int> end(m);
  for (int i = 0; i < m; i++) {
    end[i] = i;
    for (int j = 0; j < lg; j++) {
      if (((n - 1) >> j) & 1) {
        end[i] = jump[j][end[i]];
      }
    }
  }
  RMQ<int> rmq(end);
  while (q-- > 0) {
    int l, r;
    std::cin >> l >> r;
    l--;
    std::cout << (end[rmq(l, r)] < r);
  }
  std::cout << '\n';
}
