#include <bits/stdc++.h>
using namespace std;
int n, m, que, a[400005], b[400005], pos[400005], t, las[400005], f[400005][22],
    g[400005], a1, a2, ans;
struct node {
  int l, r, v;
  node *ch[2];
} * root;
int gets() {
  int v = 0;
  char ch;
  bool f = 0;
  while (!isdigit(ch = getchar()))
    if (ch == '-') f = 1;
  v = ch - 48;
  while (isdigit(ch = getchar())) v = (v << 1) + (v << 3) + ch - 48;
  return f ? -v : v;
}
void pushup(node *x) { x->v = max(x->ch[0]->v, x->ch[1]->v); }
void build(node *&x, int l, int r) {
  x = new node();
  x->l = l, x->r = r;
  if (l == r) {
    x->v = g[l];
    return;
  }
  int mid = l + r >> 1;
  build(x->ch[0], l, mid);
  build(x->ch[1], mid + 1, r);
  pushup(x);
}
void ask(node *x, int l, int r) {
  if (x->l == l && x->r == r) {
    ans = max(ans, x->v);
    return;
  }
  int mid = x->l + x->r >> 1;
  if (r <= mid)
    ask(x->ch[0], l, r);
  else if (l > mid)
    ask(x->ch[1], l, r);
  else
    ask(x->ch[0], l, mid), ask(x->ch[1], mid + 1, r);
}
int main() {
  n = gets(), m = gets(), que = gets();
  for (int i = 1; i <= n; i++) a[i] = a[i + n] = gets(), pos[a[i]] = i + n;
  for (int i = 1; i <= m; i++) b[i] = gets();
  for (int i = 1; i <= m; i++) {
    t = a[pos[b[i]] - 1];
    f[i][0] = las[t];
    las[b[i]] = i;
  }
  for (int j = 1; j <= 20; j++)
    for (int i = 1; i <= m; i++) f[i][j] = f[f[i][j - 1]][j - 1];
  for (int i = 1; i <= m; i++) {
    t = n - 1;
    g[i] = i;
    for (int j = 20; j >= 0; j--) {
      if (t & (1 << j)) g[i] = f[g[i]][j];
    }
  }
  build(root, 1, m);
  for (int i = 1; i <= que; i++) {
    a1 = gets(), a2 = gets();
    ans = 0;
    ask(root, a1, a2);
    if (a1 <= ans)
      printf("1");
    else
      printf("0");
  }
  puts("");
  return 0;
}
