#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7, K = 20;
int p[N], incr[N], decr[N];
int last[N], a[N];
int par[N];
int anc[N][K];
int ll[N];
int get(int u, int k) {
  for (int i = K - 1; i >= 0; i--) {
    if ((1 << i) > k) continue;
    k -= (1 << i);
    u = anc[u][i];
  }
  assert(k == 0);
  return u;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) cin >> p[i];
  p[n] = p[0];
  p[n + 1] = p[1];
  for (int i = 1; i <= n; i++) {
    incr[p[i]] = p[i + 1];
    decr[p[i]] = p[i - 1];
  }
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
    last[a[i]] = i;
    int v = last[decr[a[i]]];
    par[i] = v;
  }
  for (int i = 1; i <= m; i++) {
    anc[i][0] = par[i];
    for (int k = 1; k < K; k++) anc[i][k] = anc[anc[i][k - 1]][k - 1];
  }
  for (int i = 1; i <= m; i++) ll[i] = get(i, n - 1);
  for (int i = 1; i <= m; i++) ll[i] = max(ll[i], ll[i - 1]);
  while (q--) {
    int l, r;
    cin >> l >> r;
    cout << (ll[r] >= l);
  }
}
