#include <bits/stdc++.h>
using namespace std;
struct segtree {
  int n;
  vector<int> data;
  segtree(int N) {
    n = 1;
    while (n < N) n <<= 1;
    data.assign(n * 2, INT_MAX);
  }
  void insert(int k, int x) {
    k += n;
    while (k) {
      data[k] = min(data[k], x);
      k >>= 1;
    }
  }
  int query(int l, int r) {
    l += n;
    r += n;
    int ret = INT_MAX;
    while (l <= r) {
      if (l % 2 == 1) ret = min(ret, data[l++]);
      if (r % 2 == 0) ret = min(ret, data[r--]);
      l >>= 1;
      r >>= 1;
    }
    return ret;
  }
};
int main() {
  int n, m, q;
  cin >> n >> m >> q;
  vector<int> p(n);
  vector<int> r(n);
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    p[i]--;
    r[p[i]] = i;
  }
  int mx_jump = 1;
  int z = 1;
  while (mx_jump < n) {
    mx_jump <<= 1;
    z++;
  }
  vector<vector<int> > j(z);
  for (int i = 0; i < z; i++) j[i].assign(m, -1);
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  vector<int> last(n, -1);
  for (int i = m - 1; i >= 0; i--) {
    int x = a[i] - 1;
    int next = p[(r[x] + 1) % n];
    j[0][i] = last[next];
    last[x] = i;
  }
  for (int i = 1; i < z; i++) {
    for (int k = 0; k < m; k++) {
      if (j[i - 1][k] == -1) {
        j[i][k] = -1;
      } else {
        j[i][k] = j[i - 1][j[i - 1][k]];
      }
    }
  }
  segtree st(m);
  for (int i = 0; i < m; i++) {
    int target = i;
    int z = 0, jump = 1;
    while (jump <= (n - 1)) {
      if (target == -1) break;
      if (jump & (n - 1)) {
        target = j[z][target];
      }
      z++;
      jump <<= 1;
    }
    if (target == -1) {
      target = INT_MAX;
    }
    st.insert(i, target);
  }
  while (q--) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    bool ans = st.query(u, v) <= v;
    cout << ans;
  }
  cout << endl;
  return 0;
}
