#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int n;
vector<int> rr;
vector<int> used;
void dfs(int v, deque<int> &now, vector<vector<int>> &g) {
  used[v] = 1;
  if (now.size() == n - 1) {
    int t = now.front();
    rr[v] = t;
    if (!g[v].empty()) {
      now.pop_front();
      now.push_back(v);
      for (int i : g[v]) dfs(i, now, g);
      now.pop_back();
      now.push_front(t);
    }
  } else if (!g[v].empty()) {
    now.push_back(v);
    for (int i : g[v]) dfs(i, now, g);
    now.pop_back();
  }
}
vector<int> rmq;
void build(int t, int l, int r) {
  if (l + 1 == r)
    rmq[t] = rr[l];
  else {
    int m = (l + r) / 2;
    build(t * 2 + 1, l, m);
    build(t * 2 + 2, m, r);
    rmq[t] = min(rmq[t * 2 + 1], rmq[t * 2 + 2]);
  }
}
int get(int t, int l, int r, int x, int y) {
  if (y <= l || r <= x) return (int)1e9;
  if (x <= l && r <= y) return rmq[t];
  int m = (l + r) / 2;
  return min(get(t * 2 + 1, l, m, x, y), get(t * 2 + 2, m, r, x, y));
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int m, q;
  cin >> n >> m >> q;
  if (n == 1) {
    for (int i = 0; i < q; ++i) cout << 1;
    cout << endl;
    return 0;
  }
  vector<vector<int>> g(m);
  vector<int> perm(n);
  for (int i = 0; i < n; ++i) cin >> perm[i];
  vector<int> tr(n);
  for (int i = 0; i < n; ++i) tr[perm[i] - 1] = i;
  vector<int> a(m);
  for (int i = 0; i < m; ++i) cin >> a[i];
  for (int i = 0; i < m; ++i) a[i] = tr[a[i] - 1];
  vector<int> last(n, -1);
  for (int i = m - 1; i >= 0; --i) {
    last[a[i]] = i;
    if (last[(a[i] + 1) % n] != -1) g[last[(a[i] + 1) % n]].push_back(i);
  }
  rr.resize(m, (int)1e9);
  used.resize(m);
  deque<int> st;
  for (int i = m - 1; i >= 0; --i) {
    if (!used[i]) dfs(i, st, g);
  }
  rmq.resize(m * 4);
  build(0, 0, m);
  for (int i = 0; i < q; ++i) {
    int l, r;
    cin >> l >> r;
    if (get(0, 0, m, l - 1, r) <= r - 1)
      cout << 1;
    else
      cout << 0;
  }
  return 0;
}
