#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, M = 20;
int n, m, q;
int p[N], arr[N], to[N];
int last[N], ans[N], par[N][M];
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", p + i);
    if (i) to[p[i - 1]] = p[i];
  }
  to[p[n - 1]] = p[0];
  for (int i = 0; i < m; i++) scanf("%d", arr + i);
  memset(last, -1, sizeof last);
  for (int i = m - 1; i >= 0; i--) {
    last[arr[i]] = i;
    par[i][0] = last[to[arr[i]]];
  }
  ans[m] = 1e9;
  for (int i = m - 1; i >= 0; i--) {
    for (int j = 1; j < M; j++) {
      if (~par[i][j - 1])
        par[i][j] = par[par[i][j - 1]][j - 1];
      else
        par[i][j] = -1;
    }
    int node = i;
    for (int j = 0; j < M && ~node; j++)
      if ((n - 1) & (1 << j)) node = par[node][j];
    node = node == -1 ? 1e9 : node;
    ans[i] = min(ans[i + 1], node);
  }
  int s, e;
  while (q--) {
    scanf("%d%d", &s, &e);
    putchar(ans[s - 1] < e ? '1' : '0');
  }
}
