#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
const int N = 2e5 + 5, L = 20;
int p[N], a[N], pos[N], last[N], dp[N], lb[N], t[N * 4], go[N][L];
bool full[N];
void build(int v, int L, int R) {
  if (L == R) {
    t[v] = full[L] ? lb[L] : -1;
  } else {
    int m = (L + R) >> 1;
    build(v * 2, L, m);
    build(v * 2 + 1, m + 1, R);
    t[v] = max(t[v * 2], t[v * 2 + 1]);
  }
}
int que(int l, int r, int v, int L, int R) {
  if (l > r) return -1;
  if (l == L && r == R) return t[v];
  int m = (L + R) >> 1;
  return max(que(l, min(m, r), v * 2, L, m),
             que(max(m + 1, l), r, v * 2 + 1, m + 1, R));
}
signed main() {
  ios_base::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];
    pos[p[i]] = i;
  }
  p[n] = p[0];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  memset(lb, -1, sizeof(lb));
  memset(last, -1, sizeof(last));
  for (int i = 0; i < m; i++) {
    int pr = p[(pos[a[i]] + n - 1) % n];
    dp[a[i]] = min(n, dp[pr] + 1);
    if (dp[a[i]] == 1) {
      lb[i] = i;
    } else if (dp[pr] == n) {
      int x = last[pr], y = n - 2;
      for (int j = L - 1; j >= 0; j--) {
        if (y >= (1 << j)) {
          y -= (1 << j);
          x = go[x][j];
        }
      }
      lb[i] = x;
    } else {
      lb[i] = lb[last[pr]];
    }
    if (last[pr] != -1) {
      go[i][0] = last[pr];
      for (int j = 1; j < L; j++) go[i][j] = go[go[i][j - 1]][j - 1];
    }
    if (dp[a[i]] == n) full[i] = true;
    last[a[i]] = i;
  }
  build(1, 0, m - 1);
  while (q--) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    cout << (que(l, r, 1, 0, m - 1) >= l);
  }
  return 0;
}
