#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9;
const int N = 250000 * 2;
const int LOGN = 18;
int n, m, q;
int dp[N][LOGN], p[N], nxt[N], a[N], bk[N], mn[N], seg[4 * N];
void build(int n, int s, int e) {
  if (s == e) {
    seg[n] = mn[s];
    return;
  }
  build(2 * n, s, (s + e) / 2);
  build(2 * n + 1, (s + e) / 2 + 1, e);
  seg[n] = min(seg[2 * n], seg[2 * n + 1]);
}
int get(int n, int s, int e, int l, int r) {
  if (s > r || e < l) return oo;
  if (s >= l && e <= r) return seg[n];
  return min(get(2 * n, s, (s + e) / 2, l, r),
             get(2 * n + 1, (s + e) / 2 + 1, e, l, r));
}
int main() {
  cin >> n >> m >> q;
  memset(dp, -1, sizeof dp);
  memset(nxt, -1, sizeof nxt);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", p + i);
    bk[p[i]] = i;
  }
  for (int i = 1; i <= m; ++i) scanf("%d", a + i);
  for (int i = m; i >= 1; --i) {
    int myNext = bk[a[i]] + 1;
    if (myNext > n) myNext = 1;
    myNext = p[myNext];
    dp[i][0] = nxt[myNext];
    nxt[a[i]] = i;
  }
  for (int k = 1; k < LOGN; ++k) {
    for (int j = 1; j <= m; ++j) {
      if (dp[j][k - 1] == -1) continue;
      dp[j][k] = dp[dp[j][k - 1]][k - 1];
    }
  }
  for (int i = 1; i <= m; ++i) {
    mn[i] = oo;
    int rem = n - 1;
    int go = i;
    for (int k = LOGN - 1; k >= 0; --k) {
      if (rem >= (1 << k)) {
        if (dp[go][k] == -1) break;
        rem -= (1 << k);
        go = dp[go][k];
      }
    }
    if (rem == 0) mn[i] = go;
  }
  build(1, 1, m);
  for (int l, r, i = 0; i < q; ++i) {
    scanf("%d%d", &l, &r);
    int mn = get(1, 1, m, l, r);
    if (mn <= r) {
      printf("1");
    } else {
      printf("0");
    }
  }
  puts("");
  return 0;
}
