#include <bits/stdc++.h>
using namespace std;
long long n, m, q;
vector<long long> a, p, rp;
vector<vector<long long>> b;
int main() {
  cin >> n >> m >> q;
  p.resize(n);
  a.resize(m);
  b.resize(m);
  rp.resize(n + 1, 0);
  for (int(i) = 0; (i) < (m); ++(i)) b[i].resize(20, -1);
  for (int(i) = 0; (i) < (n); ++(i)) cin >> p[i];
  for (int(i) = 0; (i) < (m); ++(i)) cin >> a[i];
  for (int(i) = 0; (i) < (n); ++(i)) rp[p[i]] = i;
  vector<int> lastPos;
  lastPos.resize(n + 1, -1);
  for (int i = 0; i < m; ++i) {
    if (a[i] >= 1 && a[i] <= n) {
      lastPos[a[i]] = i;
      int prev = rp[a[i]] - 1;
      if (prev == -1) prev = n - 1;
      b[i][0] = lastPos[p[prev]];
    }
  }
  for (int j = 0; j < 20; ++j) {
    for (int i = 0; i < m; ++i) {
      int t = b[i][j];
      if (t >= 0) {
        t = b[t][j];
        b[i][j + 1] = t;
      }
    }
  }
  vector<int> bn_1;
  bn_1.resize(m, -1);
  for (int(i) = 0; (i) < (m); ++(i)) {
    int rem = n - 1;
    int j = 20;
    int ans = i;
    while (rem > 0 && ans >= 0) {
      while (((rem >> j) & 1) == 0) --j;
      ans = b[ans][j];
      rem -= (1 << j);
    }
    bn_1[i] = ans;
  }
  for (int i = 1; i < m; ++i) {
    bn_1[i] = max(bn_1[i], bn_1[i - 1]);
  }
  for (int(i) = 0; (i) < (q); ++(i)) {
    long long l, r;
    cin >> l >> r;
    --l;
    --r;
    if (bn_1[r] >= l)
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
  return 0;
}
