#include <bits/stdc++.h>
const int N = 200010;
using namespace std;
int n, m, q, P[N], pos[N], nxt[N], a[N], fa[N][20], dep[N], st[N][20], Log[N];
vector<int> G[N];
void dfs(int u) {
  for (int i = 1; i <= 19; ++i) fa[u][i] = fa[fa[u][i - 1]][i - 1];
  for (int v : G[u]) dep[v] = dep[u] + 1, dfs(v);
}
int jump(int u, int K) {
  for (int i = 19; i >= 0; --i)
    if (K & (1 << i)) u = fa[u][i];
  u = (u == 0 ? m + 1 : u);
  return u;
}
void init_rmq() {
  for (int i = 1; i <= m; ++i) st[i][0] = a[i];
  for (int i = 2; i <= m; ++i) Log[i] = Log[i >> 1] + 1;
  for (int k = 1; k <= 19; ++k)
    for (int i = 1; i + (1 << k - 1) <= m; ++i)
      st[i][k] = min(st[i][k - 1], st[i + (1 << (k - 1))][k - 1]);
}
int ask(int l, int r) {
  int L = Log[r - l + 1];
  return min(st[l][L], st[r - (1 << L) + 1][L]);
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = (1); i <= (n); ++i) scanf("%d", &P[i]), pos[i] = m + 1;
  ;
  for (int i = (1); i <= (n - 1); ++i) nxt[P[i]] = P[i + 1];
  nxt[P[n]] = P[1];
  for (int i = (1); i <= (m); ++i) scanf("%d", &a[i]);
  for (int i = (m); i >= (1); --i) {
    fa[i][0] = pos[nxt[a[i]]];
    G[fa[i][0]].push_back(i);
    pos[a[i]] = i;
  }
  dfs(m + 1);
  for (int i = (1); i <= (m); ++i) a[i] = jump(i, n - 1);
  init_rmq();
  while (q--) {
    int l, r;
    scanf("%d%d", &l, &r);
    if (r >= ask(l, r))
      putchar('1');
    else
      putchar('0');
  }
  putchar('\n');
}
