#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = (((1 << 30) - 1) << 1) + 1;
const int nINF = 1 << 31;
const int N = 2e5 + 10;
int ts[N], te[N], lcat = 0;
vector<int> g[N], ba[N];
void lcadfs(int s, int p = 0, int d = 0) {
  ts[s] = lcat++;
  ba[s].push_back(p);
  for (int i = 1; d - (1 << i) >= 0; ++i)
    ba[s].push_back(ba[ba[s][i - 1]][i - 1]);
  for (int v : g[s])
    if (v != p) lcadfs(v, s, d + 1);
  te[s] = lcat++;
}
int n, m, q, p[N], a[N], ear[N], leaf[N], b[N];
set<pair<int, int> > segs;
stack<int> lastids[N];
int jump_forward(int k) {
  int num = n - 1;
  for (int i = (0); i <= (20); i++) {
    if ((1 << i) & num) {
      if (i < ba[k].size())
        k = ba[k][i];
      else
        return 0;
    }
  }
  return k;
}
signed main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> q;
  for (int i = (1); i <= (n); i++) cin >> p[i];
  b[p[1]] = p[n];
  for (int i = (2); i <= (n); i++) b[p[i]] = p[i - 1];
  for (int i = (1); i <= (m); i++) cin >> a[i];
  for (int i = (1); i <= (m); i++) {
    int bef = b[a[i]];
    stack<int>& s = lastids[bef];
    while (!s.empty()) {
      g[i].push_back(s.top());
      leaf[s.top()] = 1;
      s.pop();
    }
    lastids[a[i]].push(i);
  }
  for (int i = (1); i <= (m); i++)
    if (!leaf[i]) lcadfs(i);
  for (int i = (1); i <= (m); i++) ear[i] = jump_forward(i);
  for (int i = (1); i <= (m); i++) {
    if (ear[i]) {
      while (segs.size() && segs.rbegin()->second >= ear[i])
        segs.erase(*segs.rbegin());
      segs.insert({i, ear[i]});
    }
  }
  while (q--) {
    int l, r;
    cin >> l >> r;
    auto itr = segs.lower_bound({l, 0});
    cout << !(itr == segs.end() || itr->second > r);
  }
  cout << endl;
  return 0;
}
