#include <bits/stdc++.h>
using namespace std;
const long long mod = 2147493647;
int n, m, q;
int a[1000010], b[1000010], pre[1000010], last[1000010];
int f[600010][20];
int seq[600010];
int t;
int find(int x) {
  int len = n - 1;
  int pos = x;
  for (int i = t; i >= 0 && len; --i) {
    if ((1 << i) <= len) {
      pos = f[pos][i];
      len -= (1 << i);
    }
  }
  return pos;
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  t = 0;
  while ((1 << t) < n) t++;
  for (int i = 1; i < n + 1; ++i) {
    scanf("%d", &a[i]);
    pre[a[i]] = a[i - 1];
  }
  pre[a[1]] = a[n];
  memset(last, 0, sizeof(last));
  for (int i = 1; i < m + 1; ++i) {
    scanf("%d", &b[i]);
    if (last[pre[b[i]]] > 0) {
      f[i][0] = last[pre[b[i]]];
      for (int j = 1; j <= t; ++j) {
        if (f[i][j - 1] == 0) break;
        f[i][j] = f[f[i][j - 1]][j - 1];
      }
    }
    last[b[i]] = i;
  }
  memset(seq, 0, sizeof(seq));
  for (int i = 1; i < m + 1; ++i) {
    seq[i] = find(i);
    seq[i] = max(seq[i - 1], seq[i]);
  }
  for (int i = 0; i < q; ++i) {
    int l, r;
    scanf("%d%d", &l, &r);
    if (seq[r] < l) {
      printf("0");
    } else
      printf("1");
  }
  printf("\n");
}
