#include <bits/stdc++.h>
using namespace std;
const int sz = (1 << 18) - 1, INF = 1e9;
int t[sz * 2];
void upd(int v, int x) {
  t[v += sz] = x;
  while ((v >>= 1) >= 1) t[v] = min(t[v << 1], t[(v << 1) | 1]);
}
int get(int l, int r) {
  int res = INF;
  for (l += sz, r += sz; l <= r; l >>= 1, r >>= 1) {
    if (l & 1) res = min(res, t[l++]);
    if (!(r & 1)) res = min(res, t[r--]);
    if (l > r) break;
  }
  return res;
}
int n, m, q, x, f[sz], mn[sz], a[sz], pr[sz][19], pos[sz];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    f[x] = i;
  }
  for (int i = 1; i <= m; ++i) {
    mn[i] = INF;
    cin >> a[i];
    a[i] = f[a[i]];
    int z = a[i] - 1;
    if (!z) z = n;
    pr[i][0] = pos[z];
    for (int j = 1; pr[pr[i][j - 1]][j - 1]; ++j)
      pr[i][j] = pr[pr[i][j - 1]][j - 1];
    int o = n - 1, v = i, pw = 0;
    while (o) {
      if (o & 1) v = pr[v][pw];
      ++pw;
      o >>= 1;
    }
    mn[v] = min(mn[v], i);
    pos[a[i]] = i;
  }
  for (int i = m; i >= 1; --i) {
    upd(i, mn[i]);
  }
  for (int i = 1; i <= q; ++i) {
    int l, r;
    cin >> l >> r;
    cout << (get(l, r) <= r);
  }
  return 0;
}
