#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, q;
  cin >> n >> m >> q;
  vector<int> p(n);
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
    --p[i];
  }
  vector<int> a(m);
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
    --a[i];
  }
  int nbits = 1;
  for (; (n >> nbits) > 0;) ++nbits;
  vector<vector<int> > jump(m, vector<int>(nbits, m));
  vector<int> ind(n, -1);
  for (int i = 0; i < n; ++i) {
    ind[p[i]] = i;
  }
  vector<int> first(n, m);
  for (int i = m - 1; i >= 0; --i) {
    int next = p[(ind[a[i]] + 1) % n];
    jump[i][0] = first[next];
    first[a[i]] = i;
  }
  for (int i = 1; i < nbits; ++i) {
    for (int j = 0; j < m; ++j) {
      if (jump[j][i - 1] < m) {
        jump[j][i] = jump[jump[j][i - 1]][i - 1];
      }
    }
  }
  vector<int> end(m, m);
  for (int i = m - 1; i >= 0; --i) {
    if (i + 1 < m) {
      end[i] = end[i + 1];
    }
    int j = i;
    for (int bit = 0; bit < nbits && j < end[i]; ++bit) {
      if ((((n - 1) >> bit) & 1) != 0) {
        j = jump[j][bit];
      }
    }
    end[i] = min(end[i], j);
  }
  for (; q > 0; --q) {
    int l, r;
    cin >> l >> r;
    --l;
    --r;
    if (end[l] <= r)
      cout << '1';
    else
      cout << '0';
  }
  cout << endl;
}
