#include <bits/stdc++.h>
using namespace std;
int dp[200005][20];
int arr[200005];
int brr[200005];
int late[200005];
int parent[200005];
int t[2 * 200005];
int n, m;
void build() {
  n = m;
  for (int i = n - 1; i > 0; --i) t[i] = max(t[i << 1], t[i << 1 | 1]);
}
int query(int l, int r) {
  int res = 0;
  n = m;
  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    if (l & 1) res = max(res, t[l++]);
    if (r & 1) res = max(res, t[--r]);
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, q;
  cin >> n >> m >> q;
  for (int i = 1; i < n + 1; i++) {
    cin >> arr[i];
    parent[arr[i]] = arr[i - 1];
  }
  parent[arr[1]] = arr[n];
  for (int i = 1; i < m + 1; i++) {
    cin >> brr[i];
    int x = parent[brr[i]];
    dp[i][0] = late[x];
    for (int j = 1; j < 20; j++) {
      dp[i][j] = dp[dp[i][j - 1]][j - 1];
    }
    late[brr[i]] = i;
    x = i;
    int y = n;
    for (int j = 20; j >= 0; j--) {
      if ((1 << j) < y) {
        y -= (1 << j);
        x = dp[x][j];
      }
    }
    t[i + m - 1] = x;
  }
  build();
  while (q--) {
    int l, r;
    cin >> l >> r;
    int x = query(l - 1, r);
    if (x >= l) {
      cout << 1;
    } else
      cout << 0;
  }
}
