#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
template <typename T, typename OP>
struct seg_tree {
  OP op;
  T *t;
  int n;
  int L, R;
  vector<T> &v;
  T build(int l, int r, int i) {
    if (l == r) return t[i] = op(v[l]);
    int m = (l + r) / 2;
    T lb = build(l, m, 2 * i + 1);
    T rb = build(m + 1, r, 2 * i + 2);
    return t[i] = op(lb, rb);
  }
  T query(int l, int r, int i) {
    if (L <= l && r <= R) return t[i];
    int m = (l + r) / 2;
    if (m >= R) return query(l, m, 2 * i + 1);
    if (m < L) return query(m + 1, r, 2 * i + 2);
    return op(query(l, m, 2 * i + 1), query(m + 1, r, 2 * i + 2));
  }
  T query(int L_, int R_) {
    L = L_;
    R = R_;
    return query(0, n - 1, 0);
  }
  T update(int l, int r, int i, int k) {
    if (l == r) return t[i] = op(v[k]);
    int m = (l + r) / 2;
    if (m >= k) return t[i] = op(t[2 * i + 2], update(l, m, 2 * i + 1, k));
    if (m < k) return t[i] = op(t[2 * i + 1], update(m + 1, r, 2 * i + 2, k));
    return t[i] =
               op(update(l, m, 2 * i + 1, k), update(m + 1, r, 2 * i + 2, k));
  }
  T update(int k) { return update(0, n - 1, 0, k); }
  seg_tree(vector<T> &v_) : v(v_) {
    n = v.size();
    t = new T[4 * n + 1];
    build(0, n - 1, 0);
  }
  ~seg_tree() { delete[] t; }
  seg_tree() {}
};
template <typename T>
struct max_el {
  T operator()(const T &l) { return l; }
  T operator()(const T &l, const T &r) { return max(l, r); }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, q;
  cin >> n >> m >> q;
  vector<int> p(n), a(m);
  for (int &i : p) cin >> i;
  for (int &i : a) cin >> i;
  vector<int> prev_p(n + 1);
  prev_p[p[0]] = p[n - 1];
  for (int i = 1; i < n; i++) prev_p[p[i]] = p[i - 1];
  vector<vector<int>> prev(m, vector<int>(20, -1));
  vector<int> last_occ(n + 1, -1);
  for (int i = 0; i < m; i++) {
    prev[i][0] = last_occ[prev_p[a[i]]];
    last_occ[a[i]] = i;
  }
  for (int i = 1; i < 20; i++)
    for (int j = 0; j < m; j++)
      if (prev[j][i - 1] != -1) prev[j][i] = prev[prev[j][i - 1]][i - 1];
  auto occ = [&](int p, int n) {
    int ans = p;
    for (int it = 19; it >= 0; it--) {
      if (n & (1 << it)) {
        ans = prev[ans][it];
      }
      if (ans == -1) break;
    }
    return ans;
  };
  vector<int> t(m + 1, 0);
  for (int i = 0; i < m; i++) t[i] = occ(i, n - 1);
  seg_tree<int, max_el<int>> st(t);
  while (q--) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    int pos = st.query(l, r);
    if (pos >= l)
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
  exit(0);
}
