#include <bits/stdc++.h>
int after[200005][18];
int dp[200005];
int permutation[200005];
int lastPosition[200005];
int pos[200005];
int a[200005];
using namespace std;
int find(int x, int steps) {
  if (x == 100000000 || steps == 0) {
    return x;
  } else {
    int k;
    for (k = 1; (1 << k) <= steps; k++)
      ;
    return find(after[x][k - 1], steps - (1 << (k - 1)));
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.setf(ios::fixed);
  cout.precision(20);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    cin >> permutation[i];
    --permutation[i];
    pos[permutation[i]] = i;
  }
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    --a[i];
  }
  for (int i = 0; i <= n; i++) {
    lastPosition[i] = 100000000;
  }
  for (int i = m - 1; i >= 0; i--) {
    lastPosition[a[i]] = i;
    for (int j = 0; (1 << j) < n; j++) {
      after[i][j] =
          find(lastPosition[permutation[(pos[a[i]] + 1) % n]], (1 << j) - 1);
    }
    dp[i] = find(i, n - 1);
    if (i < m - 1) {
      if (dp[i] > dp[i + 1]) {
        dp[i] = dp[i + 1];
      }
    }
  }
  for (int i = 0; i < q; i++) {
    int l, r;
    cin >> l >> r;
    if (dp[l - 1] <= r - 1) {
      cout << "1";
    } else {
      cout << "0";
    }
  }
  cout << endl;
}
