#include <bits/stdc++.h>
using namespace std;
int N, M, Q;
int p[200005], pos[200005];
int a[200005];
int go[200005][20];
int nxt[200005];
vector<int> adj[200005];
int dp[200005][20];
int qmin(int l, int r) {
  int k = log2(r - l);
  return min(dp[l][k], dp[r - (1 << k) + 1][k]);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> N >> M >> Q;
  for (int i = 1; i <= N; i++) {
    cin >> p[i];
    pos[p[i]] = i;
  }
  for (int i = 1; i <= M; i++) {
    cin >> a[i];
    adj[a[i]].push_back(i);
  }
  int x, y;
  for (int i = 1; i <= M; i++) {
    x = a[i];
    if (pos[x] < N)
      y = p[pos[x] + 1];
    else
      y = p[1];
    int k = upper_bound(adj[y].begin(), adj[y].end(), i) - adj[y].begin();
    if (k < adj[y].size()) go[i][0] = adj[y][k];
  }
  for (int j = 1; j < 20; j++) {
    for (int i = 1; i <= M; i++) {
      go[i][j] = go[go[i][j - 1]][j - 1];
    }
  }
  for (int i = 1; i <= M; i++) {
    int m = N - 1;
    int p = i;
    for (int j = 19; j >= 0; j--) {
      if (m >= (1 << j)) {
        m -= (1 << j);
        p = go[p][j];
      }
    }
    nxt[i] = p;
    if (nxt[i])
      dp[i][0] = nxt[i];
    else
      dp[i][0] = M + 1;
  }
  for (int j = 1; j < 20; j++) {
    for (int i = 1; i <= M; i++) {
      if (i + (1 << (j - 1)) > M) break;
      dp[i][j] = min(dp[i][j - 1], dp[i + (1 << (j - 1))][j - 1]);
    }
  }
  int l, r;
  while (Q--) {
    cin >> l >> r;
    if (qmin(l, r) <= r)
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
  return 0;
}
