#include <bits/stdc++.h>
using namespace std;
int n, m, q;
std::vector<int> p, a, asdasd, parent, parent_n, vis;
std::vector<vector<int>> g;
void dfs(int v, std::vector<int>& parents) {
  if (vis[v]) return;
  vis[v] = true;
  parents.push_back(v);
  if ((int)parents.size() - n >= 0)
    parent_n[v] = parents[(int)parents.size() - n];
  for (int u : g[v]) {
    dfs(u, parents);
  }
  parents.pop_back();
}
std::vector<int> tree;
void build(int v, int left, int right) {
  if (left + 1 == right) {
    tree[v] = parent_n[left];
    return;
  }
  int mid = (left + right) / 2;
  build(v << 1, left, mid);
  build((v << 1) + 1, mid, right);
  tree[v] = std::max(tree[v << 1], tree[(v << 1) + 1]);
}
int get_max(int v, int tl, int tr, int left, int right) {
  if (left <= tl && tr <= right) {
    return tree[v];
  }
  if (tr <= left || tl >= right) return -1;
  if (tr - tl < 2) {
    return -1;
  }
  int mid = (tl + tr) / 2;
  return std::max(get_max(v << 1, tl, mid, left, right),
                  get_max((v << 1) + 1, mid, tr, left, right));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> q;
  p.resize(n);
  a.resize(m);
  vector<int> pos(n);
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    --p[i];
    pos[p[i]] = i;
  }
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    --a[i];
  }
  asdasd.resize(n, -1);
  g.resize(m);
  parent.resize(m, -1);
  parent_n.resize(m, -1);
  vis.resize(m);
  for (int i = 0; i < m; i++) {
    parent[i] = asdasd[(pos[a[i]] - 1 + n) % n];
    if (parent[i] != -1) g[parent[i]].push_back(i);
    asdasd[pos[a[i]]] = i;
  }
  for (int i = 0; i < m; i++) {
    std::vector<int> parents;
    dfs(i, parents);
  }
  tree.resize(4 * m);
  build(1, 0, m);
  vector<pair<int, int>> queries(q);
  for (int i = 0; i < q; i++) {
    cin >> queries[i].first >> queries[i].second;
    queries[i].first--;
    int max = get_max(1, 0, m, queries[i].first, queries[i].second);
    std::cout << "01"[max >= queries[i].first];
  }
}
