#include <bits/stdc++.h>
using namespace std;
int n, m, q;
int suf[200001];
int nxt[19][200001];
int a[200001], p[200001];
int lst[200001], rig[200001];
int nxtN(int i) {
  int k = n - 1;
  for (int j = 18; j >= 0; j--)
    if ((1 << j) <= k) {
      k -= (1 << j);
      i = nxt[j][i];
    }
  return i == 0 ? 1e9 : i;
}
int main(void) {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    suf[p[i - 1]] = p[i];
  }
  suf[p[n]] = p[1];
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  for (int i = m; i >= 1; i--) {
    nxt[0][i] = lst[suf[a[i]]];
    lst[a[i]] = i;
  }
  for (int i = 1; (1 << i) < m; i++)
    for (int j = 1; j <= m; j++) nxt[i][j] = nxt[i - 1][nxt[i - 1][j]];
  for (int i = 1; i <= m; i++) rig[i] = nxtN(i);
  for (int i = m - 1; i >= 0; i--) rig[i] = min(rig[i + 1], rig[i]);
  int l, r;
  while (q--) {
    scanf("%d%d", &l, &r);
    putchar(rig[l] <= r ? '1' : '0');
  }
  putchar('\n');
  return 0;
}
