#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> bucket[200001];
int a[200001], p[200001];
int pos[200001];
int up[200001][30];
int step[200001];
int last[200001];
int mv(int pos, int step) {
  int i = 0;
  while (step != 0) {
    if (step % 2 == 1) pos = up[pos][i];
    step /= 2;
    i++;
    if (pos == -1) return -1;
  }
  return pos;
}
int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i]);
    pos[p[i]] = i;
  }
  for (int i = 0; i < m; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) last[i] = -1;
  for (int i = 0; i < m; i++) {
    int prev;
    if (pos[a[i]] == 0)
      prev = p[n - 1];
    else
      prev = p[pos[a[i]] - 1];
    up[i][0] = last[prev];
    last[a[i]] = i;
  }
  for (int pow = 1; pow <= 20; pow++) {
    for (int i = 0; i < m; i++) {
      up[i][pow] = -1;
      if (up[i][pow - 1] != -1) {
        int next = up[i][pow - 1];
        if (next != -1) up[i][pow] = up[next][pow - 1];
      }
    }
  }
  for (int i = 0; i < q; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    l--;
    r--;
    bucket[r].push_back({l, i});
  }
  string ans;
  ans.resize(q);
  int max_left = -1;
  for (int i = 0; i < m; i++) {
    int pos = mv(i, n - 1);
    if (pos != -1) max_left = max(max_left, pos);
    for (int j = 0; j < bucket[i].size(); j++)
      if (bucket[i][j].first <= max_left)
        ans[bucket[i][j].second] = '1';
      else
        ans[bucket[i][j].second] = '0';
  }
  printf("%s", ans.c_str());
  return 0;
}
