#include <bits/stdc++.h>
using namespace std;
int n, m, q;
int a[200001], b[1000001];
int np[200001];
int pre[2000001];
int g[200001][30];
int ng[200001];
int last = 0;
int find(int v) {
  int d = n - 1;
  for (int k = last; k >= 0; --k) {
    if (((1 << k) > d)) continue;
    d -= (1 << k);
    v = g[v][k];
    if (v == 0) return 0;
  }
  return v;
}
int t[10000001];
void build(int v, int tl, int tr) {
  if (tl == tr)
    t[v] = 300000;
  else {
    int tm = (tl + tr) / 2;
    build(v * 2, tl, tm);
    build(v * 2 + 1, tm + 1, tr);
    t[v] = 300000;
  }
}
void update(int v, int tl, int tr, int pos, int new_val) {
  if (tl == tr) {
    t[v] = new_val;
    return;
  }
  int tm = (tl + tr) / 2;
  if (pos <= tm)
    update(v * 2, tl, tm, pos, new_val);
  else
    update(v * 2 + 1, tm + 1, tr, pos, new_val);
  t[v] = min(t[v * 2], t[v * 2 + 1]);
}
int sum(int v, int tl, int tr, int l, int r) {
  if (l > r) return 30000000;
  if (l == tl && r == tr) {
    return t[v];
  }
  int tm = (tl + tr) / 2;
  return min(sum(v * 2, tl, tm, l, min(r, tm)),
             sum(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r));
}
vector<int> pre1[200001];
int main() {
  cin >> n >> m >> q;
  int e = 1;
  while (e <= n - 1) {
    e *= 2;
    ++last;
  }
  --last;
  for (int k = 1; k <= n; ++k) {
    cin >> a[k];
    np[a[k]] = a[k - 1];
  }
  np[a[1]] = a[n];
  for (int k = 1; k <= m; ++k) {
    cin >> b[k];
    int neighbour = np[b[k]];
    pre[b[k]] = k;
    pre1[b[k]].push_back(k);
    if (pre[neighbour] == 0) continue;
    for (int i = 0; i < pre1[neighbour].size(); ++i) {
      int nb = pre1[neighbour][i];
      if (g[nb][0] != 0) {
        continue;
      }
      g[nb][0] = k;
    }
    pre1[neighbour].clear();
  }
  for (int k = m; k >= 1; --k) {
    for (int i = 1; i <= 30; ++i) {
      if (g[k][i - 1] == 0) continue;
      g[k][i] = g[g[k][i - 1]][i - 1];
    }
  }
  build(1, 1, m);
  for (int k = 1; k <= m; ++k) {
    ng[k] = find(k);
    if (ng[k] == 0) ng[k] = 3000000;
    update(1, 1, m, k, ng[k]);
  }
  for (int k = 1; k <= q; ++k) {
    int l, r;
    cin >> l >> r;
    if (sum(1, 1, m, l, r) <= r) {
      cout << 1;
    } else
      cout << 0;
  }
  return 0;
}
