#include <bits/stdc++.h>
struct seg_tree {
  std::vector<int> _data;
  int _n;
  seg_tree(const std::vector<int>& A) {
    int n = 1;
    while (n < A.size()) n++;
    _data = std::vector<int>(2 * n - 1);
    _n = n;
    for (int i = n - 1, j = 0; i < 2 * n - 1; i++, j++) _data[i] = A[j];
    for (int i = n - 2; i >= 0; i--)
      _data[i] = std::max(_data[2 * i + 1], _data[2 * (i + 1)]);
  }
  int query(int x, int y) {
    x += _n - 1;
    y += _n - 1;
    return internal_query(x, y);
  }
  int internal_query(int x, int y) {
    if (x > y) return -1;
    if (x == y) return _data[x];
    int result = -1;
    if (x % 2 == 0) {
      result = std::max(result, _data[x]);
      x += 1;
    }
    if (y % 2 == 1) {
      result = std::max(result, _data[y]);
      y -= 2;
    } else {
      y -= 1;
    }
    return std::max(result, internal_query(x / 2, y / 2));
  }
};
int main() {
  std::ios::sync_with_stdio(false);
  using namespace std;
  int n, m, q, tmp;
  cin >> n >> m >> q;
  map<int, int> M;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    M[tmp] = i;
  }
  vector<int> A(m), C(n, -1), D(m);
  for (int i = 0; i < m; i++) {
    cin >> tmp;
    A[i] = M[tmp];
  }
  const int max_log_n = 20;
  vector<vector<int> > B(max_log_n, vector<int>(m));
  for (int i = 0; i < m; i++) {
    B[0][i] = C[(A[i] - 1 + n) % n];
    C[A[i]] = i;
  }
  for (int i = 1; (1 << i) < m; i++)
    for (int j = 0; j < m; j++) {
      if (B[i - 1][j] == -1)
        B[i][j] = -1;
      else if (B[i - 1][B[i - 1][j]] == -1)
        B[i][j] = -1;
      else
        B[i][j] = B[i - 1][B[i - 1][j]];
    }
  for (int i = 0; i < m; i++) {
    int a = n - 1, j = i;
    while (a > 0 && j != -1) {
      int x = 0;
      while (a >= (1 << (x + 1))) x++;
      a -= (1 << x);
      j = B[x][j];
    }
    D[i] = j;
  }
  seg_tree E(D);
  vector<bool> answers(q);
  for (int i = 0; i < q; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    int res = E.query(a, b);
    if (res >= a)
      answers[i] = true;
    else
      answers[i] = false;
  }
  for (int i = 0; i < q; i++) cout << "01"[answers[i]];
  cout << "\n";
  return 0;
}
