#include <bits/stdc++.h>
using namespace std;
struct var {
  int to, nxt;
} edge[401001];
int n, m, qq, ans[201001], nxt[200001], pre[201001], p[201001], las[201001],
    a[201001], e[201001];
int head[201001], cnt, dep[201001], q[401001], tot;
void add(int u, int v) {
  cnt++;
  edge[cnt].to = v;
  edge[cnt].nxt = head[u];
  head[u] = cnt;
}
void dfs(int o, int dep) {
  tot++;
  q[dep] = o;
  if (dep >= n)
    ans[o] = q[dep - n + 1];
  else
    ans[o] = m + 1;
  for (int i = head[o]; i; i = edge[i].nxt) {
    int v = edge[i].to;
    dfs(v, dep + 1);
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &qq);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    nxt[p[i]] = p[i - 1];
  }
  nxt[p[1]] = p[n];
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
    pre[i] = las[a[i]];
    las[a[i]] = i;
    for (int j = las[nxt[a[i]]]; j && (!e[j]); j = pre[j]) e[j] = i;
  }
  for (int i = 1; i <= m; i++)
    if (!e[i]) e[i] = m + 1;
  for (int i = 1; i <= m; i++) add(e[i], i);
  dfs(m + 1, 1);
  for (int i = m; i >= 1; i--) ans[i] = min(ans[i + 1], ans[i]);
  int x, y;
  while (qq--) {
    scanf("%d%d", &x, &y);
    if (ans[x] <= y)
      printf("1");
    else
      printf("0");
  }
}
