#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 200000 + 5, L = 20;
int n, m, q, p[N], pos[N], a[N], oc[N], pre[N][L], st[N][L], ans[N];
int jump(int x, int k) {
  for (int i = 18; i >= 0; i--)
    if (k & (1 << i)) x = pre[x][i];
  return x;
}
int rangemax(int l, int r) {
  int lg = log2(r - l + 1);
  return max(st[l][lg], st[r - (1 << lg) + 1][lg]);
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &p[i]), pos[p[i]] = i;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
    int Find = pos[a[i]];
    if (Find == 1)
      pre[i][0] = oc[p[n]];
    else
      pre[i][0] = oc[p[Find - 1]];
    oc[a[i]] = i;
  }
  for (int j = 1; j <= 18; j++)
    for (int i = 1; i <= m; i++) pre[i][j] = pre[pre[i][j - 1]][j - 1];
  for (int i = 1; i <= m; i++) st[i][0] = jump(i, n - 1);
  for (int j = 1; j <= 18; j++)
    for (int i = 1; i <= m; i++) {
      if (i + (1 << (j)) - 1 > m) continue;
      st[i][j] = max(st[i][j - 1], st[i + (1 << (j - 1))][j - 1]);
    }
  for (int i = 1, l, r; i <= q; i++) {
    scanf("%d%d", &l, &r);
    ans[i] = (rangemax(l, r) >= l);
  }
  for (int i = 1; i <= q; i++) putchar(ans[i] + '0');
  return 0;
}
