#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const int MOD = 1e9 + 7;
int p[N];
int dp[N][30];
int lst[N];
int pos[N];
int t[N];
void build(int v, int l, int r) {
  if (l == r) {
    t[v] = pos[l];
    return;
  }
  int m = (l + r) >> 1;
  build(2 * v, l, m);
  build(2 * v + 1, m + 1, r);
  t[v] = max(t[2 * v], t[2 * v + 1]);
}
long long get(int v, int tl, int tr, int l, int r) {
  if (l <= tl && tr <= r) {
    return t[v];
  }
  int tm = (tl + tr) >> 1;
  if (r <= tm) return get(2 * v, tl, tm, l, r);
  if (l > tm) return get(2 * v + 1, tm + 1, tr, l, r);
  return max(get(2 * v, tl, tm, l, r), get(2 * v + 1, tm + 1, tr, l, r));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, q, nn;
  cin >> n >> m >> q;
  nn = n - 1;
  int f, nx = 0;
  for (int i = 0; i < n; ++i) {
    int tmp;
    cin >> tmp;
    if (!i) f = tmp;
    p[tmp] = nx;
    nx = tmp;
  }
  p[f] = nx;
  fill(lst, lst + N, -1);
  fill(t, t + N, -1);
  for (int i = 0; i < m; ++i) {
    int tmp;
    cin >> tmp;
    lst[tmp] = i;
    dp[i][0] = lst[p[tmp]];
    for (int j = 1; j < 30; ++j) {
      if (dp[i][j - 1] != -1)
        dp[i][j] = dp[dp[i][j - 1]][j - 1];
      else
        dp[i][j] = -1;
    }
    int pz = i;
    for (int j = 29; j >= 0; --j) {
      if (pz == -1) break;
      if ((1 << j) & nn) {
        pz = dp[pz][j];
      }
    }
    pos[i] = pz;
  }
  build(1, 0, m - 1);
  for (int i = 0; i < q; ++i) {
    int l, r;
    cin >> l >> r;
    --l, --r;
    if (get(1, 0, m - 1, l, r) >= l) {
      cout << 1;
    } else {
      cout << 0;
    }
  }
  return 0;
}
