#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
const double pi =
    3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int MR = 2e5 + 10;
int p[MR], a[MR], posp[MR];
vector<int> pos[MR], binDist[MR];
pair<int, int> dp[MR], best[MR];
int getLastB(int x) {
  for (int i = 0; i < (30); ++i)
    if (x & (1 << i)) return i;
  return -1;
}
int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 0; i < (n); ++i) {
    scanf("%d", &p[i]);
    p[i]--;
    posp[p[i]] = i;
  }
  for (int i = 0; i < (m); ++i) {
    scanf("%d", &a[i]);
    a[i]--;
    pos[a[i]].push_back(i);
    if (!i) {
      best[0] = dp[0] = make_pair(1, 0);
      continue;
    }
    if (n == 1) {
      best[i] = dp[i] = make_pair(1, i);
      continue;
    }
    best[i] = best[i - 1];
    int wsk = posp[a[i]] - 1;
    if (wsk < 0) wsk += n;
    int prev = p[wsk];
    if (pos[prev].empty()) {
      if (best[i].first == 1) best[i].second = i;
      dp[i] = make_pair(1, i);
      continue;
    }
    int pospop = pos[prev].back();
    {
      int wsk = 0;
      binDist[i].push_back(pospop);
      while (true) {
        wsk++;
        if (binDist[pospop].size() <= wsk - 1) break;
        pospop = binDist[pospop][wsk - 1];
        binDist[i].push_back(pospop);
      }
    }
    pospop = pos[prev].back();
    if (dp[pospop].first < n) {
      dp[i] = dp[pospop];
      dp[i].first++;
    } else {
      int ile = n - 1, akt = i;
      while (ile) {
        akt = binDist[akt][getLastB(ile)];
        ile &= ile - 1;
      }
      dp[i] = make_pair(n, akt);
    }
    best[i] = max(best[i], dp[i]);
  }
  for (int c = 0; c < (q); ++c) {
    int l, r;
    scanf("%d%d", &l, &r);
    l--;
    r--;
    if (best[r].first == n && best[r].second >= l)
      printf("1");
    else
      printf("0");
  }
  printf("\n");
  return 0;
}
