#include <bits/stdc++.h>
using namespace std;
template <typename X, typename Y>
static inline void xmin(X &x, Y y) {
  if (y < x) x = y;
}
template <typename X, typename Y>
static inline void xmax(X &x, Y y) {
  if (x < y) x = y;
}
long long pw(long long x, long long y, long long md) {
  if (!y) return 1;
  if (y & 1) return (x * pw(x, y - 1, md)) % md;
  long long tmp = pw(x, y / 2, md);
  return (tmp * tmp) % md;
}
int n, m, q, l, r, a[200002], b[200002], F[200002], ans[200002], P[200002][18];
vector<int> G[200002];
int get(int x, int d) {
  int cnt = 0;
  while (d) {
    if (d & 1) x = P[x][cnt];
    ++cnt;
    d >>= 1;
  }
  return x;
}
void solve() {
  cin >> n >> m >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    F[a[i - 1]] = a[i];
  }
  F[a[n]] = a[1];
  for (int i = 1; i <= m; ++i) {
    cin >> b[i];
    G[b[i]].push_back(i);
  }
  for (int i = 1; i <= m; ++i) {
    auto it = lower_bound(G[F[b[i]]].begin(), G[F[b[i]]].end(), i);
    if (it == G[F[b[i]]].end())
      P[i][0] = m + 1;
    else
      P[i][0] = *it;
  }
  for (int j = 1; j < 18; ++j) {
    for (int i = 1; i <= m; ++i) P[i][j] = P[P[i][j - 1]][j - 1];
  }
  for (int i = 1; i <= m; ++i) ans[i] = get(i, n - 1);
  ans[m + 1] = m + 1;
  for (int i = m; i >= 1; --i) {
    if (!ans[i]) ans[i] = m + 1;
    xmin(ans[i], ans[i + 1]);
  }
  while (q--) {
    cin >> l >> r;
    if (ans[l] <= r)
      cout << 1;
    else
      cout << 0;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int TESTS = 1;
  while (TESTS--) solve();
  return 0;
}
