#include <bits/stdc++.h>
using namespace std;
struct segtree {
  vector<int> seg;
  int size;
  int neutro;
  int f(int a, int b) { return min(a, b); }
  segtree(vector<int> &v, int neu = 0) {
    int n = 1;
    while (n < v.size()) n = n << 1;
    seg.assign(2 * n, neu);
    size = n;
    neutro = neu;
    build(v, 0, 0, size);
  }
  void build(vector<int> &v, int x, int lx, int rx) {
    if (rx - lx == 1) {
      if (lx < v.size()) seg[x] = v[lx];
      return;
    }
    int mid = lx + (rx - lx) / 2;
    build(v, 2 * x + 1, lx, mid);
    build(v, 2 * x + 2, mid, rx);
    seg[x] = f(seg[2 * x + 1], seg[2 * x + 2]);
  }
  void set(int index, int valor, int x, int lx, int rx) {
    if (rx - lx == 1) {
      seg[x] = valor;
      return;
    }
    int mid = lx + (rx - lx) / 2;
    if (index < mid) {
      set(index, valor, 2 * x + 1, lx, mid);
    } else {
      set(index, valor, 2 * x + 2, mid, rx);
    }
    seg[x] = f(seg[2 * x + 1], seg[2 * x + 2]);
  }
  void set(int index, int valor) { set(index, valor, 0, 0, size); }
  int query(int l, int r, int x, int lx, int rx) {
    if (r <= lx || l >= rx) return neutro;
    if (lx >= l && rx <= r) return seg[x];
    int mid = lx + (rx - lx) / 2;
    return f(query(l, r, 2 * x + 1, lx, mid), query(l, r, 2 * x + 2, mid, rx));
  }
  int query(int l, int r) { return query(l, r, 0, 0, size); }
};
const int maxn = 2e5 + 10;
const int maxlog = 20;
int perm[maxn];
int v[maxn];
int prox[maxn];
int pai[maxn];
int dp[maxn][maxlog];
int jmp(int a, int j) {
  for (int i = 0; i < maxlog; i++)
    if ((j >> i) & 1) a = dp[a][i];
  return a;
}
int main() {
  int n, m, q;
  cin >> n >> m >> q;
  vector<int> perm(n);
  for (auto &k : perm) cin >> k;
  unordered_map<int, int> anterior;
  unordered_map<int, int> lastap;
  for (int i = 1; i < n; i++) {
    anterior[perm[i - 1]] = perm[i];
  }
  anterior[perm[perm.size() - 1]] = perm[0];
  for (int i = 1; i <= m; i++) cin >> v[i];
  for (int i = m; i > 0; i--) {
    pai[i] = lastap[anterior[v[i]]];
    lastap[v[i]] = i;
  }
  for (int i = 0; i < maxn; i++) {
    dp[i][0] = pai[i];
  }
  for (int j = 1; j < maxlog; j++)
    for (int i = 0; i < maxn; i++) dp[i][j] = dp[dp[i][j - 1]][j - 1];
  vector<int> proximo(m + 1);
  for (int i = 1; i <= m; i++) {
    proximo[i] = jmp(i, n - 1);
  }
  for (auto &k : proximo)
    if (k == 0) k = INT_MAX;
  segtree seg1 = segtree(proximo, INT_MAX);
  while (q--) {
    int a, b;
    cin >> a >> b;
    if (seg1.query(a, b + 1) <= b)
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
}
