#include <bits/stdc++.h>
using namespace std;
const int64_t INF = 1e18;
const int64_t LOG = 20;
int32_t main() {
  int64_t n, m, q;
  cin >> n >> m >> q;
  vector<int64_t> p(n), pos(n);
  for (int64_t i = 0; i < n; i++) cin >> p[i], p[i]--, pos[p[i]] = i;
  vector<int64_t> last(n, 0);
  vector<int64_t> a(m + 1);
  vector<vector<int64_t> > jump(m + 1, vector<int64_t>(LOG, 0));
  for (int64_t i = 1; i < m + 1; i++) {
    cin >> a[i], a[i]--;
    int64_t pp = (pos[a[i]] + n - 1) % n;
    jump[i][0] = last[pp];
    last[pos[a[i]]] = i;
  }
  for (int64_t j = 1; j < LOG; j++)
    for (int64_t i = 1; i < m + 1; i++)
      jump[i][j] = jump[jump[i][j - 1]][j - 1];
  vector<int64_t> left(m + 1, 0);
  for (int64_t i = 1; i < m + 1; i++) {
    int64_t cur = i;
    for (int64_t j = 0; j < LOG; j++)
      if ((n - 1) & (int64_t(1) << j)) cur = jump[cur][j];
    left[i] = cur;
  }
  for (int64_t i = 1; i < m + 1; i++) left[i] = max(left[i], left[i - 1]);
  for (int64_t i = 0; i < q; i++) {
    int64_t l, r;
    cin >> l >> r;
    cout << (left[r] >= l ? 1 : 0);
  }
  cout << endl;
  return 0;
}
