#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int a[maxn], nex[maxn], b[maxn], pos[maxn];
int f[maxn][21], bin[maxn], c[maxn], mn[maxn][21];
char ans[maxn];
void build(int n) {
  for (int i = 1; i <= n; i++) mn[i][0] = c[i];
  for (int j = 1; j <= bin[n]; j++) {
    for (int i = 1; i + (1 << j) - 1 <= n; i++) {
      int t = i + (1 << (j - 1));
      mn[i][j] = min(mn[i][j - 1], mn[t][j - 1]);
    }
  }
}
int query(int x, int y) {
  int j = bin[y - x + 1];
  int k = y - (1 << j) + 1;
  return min(mn[x][j], mn[k][j]);
}
int main() {
  int n, m, q, l, r;
  scanf("%d%d%d", &n, &m, &q);
  bin[0] = -1;
  for (int i = 1; i <= m; i++) bin[i] = bin[i >> 1] + 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (i > 1) nex[a[i - 1]] = a[i];
  }
  nex[a[n]] = a[1];
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
  for (int i = m; i >= 1; i--) {
    pos[b[i]] = i;
    f[i][0] = pos[nex[b[i]]];
  }
  for (int j = 0; j <= 19; j++) {
    for (int i = 1; i <= m; i++) f[i][j + 1] = f[f[i][j]][j];
  }
  for (int i = 1; i <= m; i++) {
    int len = n - 1, p = i;
    for (int j = 20; j >= 0; j--) {
      if ((1 << j) <= len) len -= 1 << j, p = f[p][j];
    }
    if (!p)
      c[i] = m + 1;
    else
      c[i] = p;
  }
  build(m);
  for (int i = 1; i <= q; i++) {
    scanf("%d%d", &l, &r);
    if (query(l, r) <= r)
      ans[i] = '1';
    else
      ans[i] = '0';
  }
  printf("%s\n", ans + 1);
  return 0;
}
