#include <bits/stdc++.h>
using namespace std;
inline void Boost() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  Boost();
  int n, m, q;
  cin >> n >> m >> q;
  vector<int> p(n);
  for (int i = 0; i < n; ++i) cin >> p[i];
  for (int i = 0; i < n; ++i) --p[i];
  vector<int> v(m);
  for (int i = 0; i < m; ++i) cin >> v[i];
  for (int i = 0; i < m; ++i) --v[i];
  vector<int> where(n);
  for (int i = 0; i < n; ++i) {
    where[p[i]] = i;
  }
  vector<int> last(n, -1);
  vector<int> DP[20];
  for (int i = 0; i < 20; ++i) DP[i].assign(m, -1);
  for (int i = 0; i < m; ++i) {
    int pos = where[v[i]] - 1;
    if (pos < 0) pos += n;
    int need = p[pos];
    DP[0][i] = last[need];
    last[v[i]] = i;
  }
  for (int i = 1; i < 20; ++i) {
    for (int j = 0; j < m; ++j) {
      int next = DP[i - 1][j];
      if (next == -1) continue;
      next = DP[i - 1][next];
      if (next == -1) continue;
      DP[i][j] = next;
    }
  }
  vector<int> pref(m, -1);
  for (int i = 0; i < m; ++i) {
    int next = i;
    int need = n - 1;
    for (int j = 20; j >= 0 && next != -1; --j) {
      if ((1 << j) <= need) {
        next = DP[j][next];
        need -= (1 << j);
      }
    }
    pref[i] = next;
  }
  for (int i = 1; i < m; ++i) pref[i] = max(pref[i], pref[i - 1]);
  for (int i = 0; i < q; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    if (pref[b] >= a) {
      cout << 1;
    } else {
      cout << 0;
    }
  }
  return 0;
}
