#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 5;
const long long int inf64 = 1e18 + 5;
const int MAX = 2e5 + 5;
const int LN = 18;
int p[MAX], pl[MAX], a[MAX], last[MAX];
int b[MAX][LN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
    pl[p[i]] = i;
  }
  for (int i = 1; i <= m; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) {
    int curr = pl[a[i]];
    int back = (curr == 1 ? n : curr - 1);
    b[i][0] = last[p[back]];
    last[a[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j < LN; j++) b[i][j] = b[b[i][j - 1]][j - 1];
  }
  auto get_kth = [&](int pos) {
    for (int i = LN - 1; i >= 0; i--) {
      if ((n - 1) >> i & 1) pos = b[pos][i];
    }
    return pos;
  };
  memset(last, 0, sizeof last);
  for (int i = 1; i <= m; i++) last[i] = max(get_kth(i), last[i - 1]);
  while (q--) {
    int l, r;
    cin >> l >> r;
    cout << (last[r] >= l ? '1' : '0');
  }
}
