#include <bits/stdc++.h>
using namespace std;
int main() {
  size_t n, m, q;
  cin >> n >> m >> q;
  vector<size_t> N, p(n + 1, 0), next(n + 1), a(m + 1, 0), last(n + 1, -1),
      right(m + 1);
  vector<vector<size_t>> bin(m + 1, vector<size_t>(18, -1));
  for (size_t i = 0, j = n - 1; i <= 17U; ++i)
    if (j & 1 << i) N.emplace_back(i);
  for (size_t i = 1; i <= n; ++i) cin >> p[i], next[p[i - 1]] = p[i];
  next[p.back()] = next.front();
  for (size_t i = 1; i <= m; ++i) cin >> a[i];
  for (size_t i = m; i; --i) {
    bin[i][0] = last[next[a[i]]];
    last[a[i]] = i;
  }
  for (size_t i = 1; i <= 17U; ++i)
    for (size_t j = 1; j <= m; ++j)
      if (~bin[j][i - 1]) bin[j][i] = bin[bin[j][i - 1]][i - 1];
  iota(right.begin(), right.end(), 0);
  for (size_t i = 1; i <= m; ++i)
    for (auto j : N)
      if (!~(right[i] = bin[right[i]][j])) break;
  for (size_t i = m - 1; i; --i) right[i] = min(right[i], right[i + 1]);
  while (q--) {
    size_t l, r;
    cin >> l >> r;
    cout << (r >= right[l]);
  }
  cout << endl;
}
