#include <bits/stdc++.h>
using namespace std;
int n, m, q;
const int MAXN = 2e5 + 5;
int p[MAXN];
int arr[MAXN];
int last[MAXN];
int curr[MAXN];
int res[MAXN];
int prefmax[MAXN];
int previ[MAXN];
int dp[MAXN][25];
int walk(int cur, int steps) {
  for (int i = 19; i >= 0; i--) {
    if (steps & (1 << i)) {
      steps -= (1 << i);
      cur = dp[cur][i];
      if (cur == -1) {
        return -1;
      }
    }
  }
  return cur;
}
int main() {
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < n; i++) {
    last[p[(i + 1) % n]] = p[i];
  }
  for (int i = 0; i <= 2e5; i++) {
    curr[i] = -1;
    previ[i] = -1;
  }
  for (int i = 0; i < m; i++) {
    curr[arr[i]] = i;
    previ[i] = curr[last[arr[i]]];
  }
  for (int i = 0; i <= 19; i++) {
    for (int j = 0; j < m; j++) {
      dp[j][i] = -1;
    }
  }
  for (int i = 0; i < m; i++) {
    dp[i][0] = previ[i];
  }
  for (int i = 1; i <= 19; i++) {
    for (int j = 0; j < m; j++) {
      if (dp[j][i - 1] == -1) {
        dp[j][i] = -1;
      } else {
        dp[j][i] = dp[dp[j][i - 1]][i - 1];
      }
    }
  }
  for (int i = 0; i < m; i++) {
    res[i] = walk(i, n - 1);
  }
  for (int i = 0; i < m; i++) {
    if (i) {
      prefmax[i] = max(prefmax[i - 1], res[i]);
    } else {
      prefmax[i] = res[i];
    }
  }
  while (q--) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    if (prefmax[r] < l) {
      cout << 0;
    } else {
      cout << 1;
    }
  }
}
