#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int N, M, Q;
int P[MAXN], A[MAXN];
int D[30][MAXN];
int L[MAXN];
int POS[MAXN];
int PRE[MAXN];
int main(void) {
  scanf("%d%d%d", &N, &M, &Q);
  for (int i = 1; i <= N; i++) scanf("%d", P + i);
  for (int i = 1; i <= M; i++) scanf("%d", A + i);
  for (int i = 1; i <= N; i++) PRE[P[i]] = P[i - 1];
  PRE[P[1]] = P[N];
  for (int i = 1; i <= M; i++) {
    D[0][i] = POS[PRE[A[i]]];
    POS[A[i]] = i;
  }
  for (int i = 1; i <= 20; i++) {
    for (int j = 1; j <= M; j++) D[i][j] = D[i - 1][D[i - 1][j]];
  }
  for (int i = 1; i <= M; i++) {
    int pos = i;
    for (int j = 20; j >= 0; j--) {
      if ((N - 1) & (1 << j)) pos = D[j][pos];
    }
    L[i] = max(pos, L[i - 1]);
  }
  int x, y;
  for (int i = 1; i <= Q; i++) {
    scanf("%d%d", &x, &y);
    if (L[y] >= x)
      printf("1");
    else
      printf("0");
  }
  printf("\n");
  return 0;
}
