#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long m = 1000000007) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
long long inverse(long long a, long long m = 1000000007) {
  return power(a, m - 2, m);
}
int dp[200005][20];
int main() {
  int n, m, q;
  cin >> n >> m >> q;
  vector<int> p(n);
  for (int i = 0; i < n; i++) cin >> p[i];
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  vector<int> nxt(n + 1);
  for (int i = 0; i < n; i++) {
    nxt[p[i]] = p[(i + 1) % n];
  }
  for (int i = 0; i < m + 1; i++)
    for (int j = 0; j < 20; j++) dp[i][j] = m;
  vector<int> last(n + 1, m);
  for (int i = m - 1; i >= 0; i--) {
    dp[i][0] = last[nxt[a[i]]];
    for (int j = 1; j < 20; j++) {
      dp[i][j] = dp[dp[i][j - 1]][j - 1];
    }
    last[a[i]] = i;
  }
  vector<int> fin(m, 0);
  for (int i = 0; i < m; i++) {
    int curr = n - 1;
    int pos = i;
    for (int j = 19; j >= 0; j--) {
      if ((1 << j) <= curr) {
        pos = dp[pos][j];
        curr -= (1 << j);
      }
    }
    fin[i] = pos;
  }
  for (int i = m - 2; i >= 0; i--) fin[i] = min(fin[i], fin[i + 1]);
  for (int i = 0; i < q; i++) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    if (fin[l] <= r)
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
}
