#include <bits/stdc++.h>
using namespace std;
const int N = 200200;
const int K = 20;
const int Inf = 1e9;
int a[N];
int b[N];
int p[N];
int nxt[N];
int lst[N];
int Bit[N];
int Anc[N][K];
int Min[N][K];
vector<int> v[N];
int Get(int i, int kth) {
  int Res = i;
  for (int k = 0; k < K; k++)
    if (kth & (1 << k)) Res = Anc[Res][k];
  return Res;
}
int GetMin(int l, int r) {
  int Jump = Bit[r - l + 1];
  return min(Min[l][Jump], Min[r - (1 << Jump) + 1][Jump]);
}
int main() {
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) scanf("%d", b + i);
  for (int i = 1; i <= m; i++) scanf("%d", a + i), v[a[i]].push_back(i);
  nxt[b[n]] = b[1];
  lst[b[1]] = b[n];
  for (int i = 1; i < n; i++) nxt[b[i]] = b[i + 1];
  for (int i = 2; i <= n; i++) lst[b[i]] = b[i - 1];
  for (int i = 1; i <= m; i++) {
    Anc[i][0] = i;
    auto it = upper_bound(v[nxt[a[i]]].begin(), v[nxt[a[i]]].end(), i);
    if (it != v[nxt[a[i]]].end()) Anc[i][0] = *it;
  }
  for (int k = 1; k < K; k++)
    for (int i = 1; i <= m; i++) Anc[i][k] = Anc[Anc[i][k - 1]][k - 1];
  for (int i = 1; i <= m; i++) {
    p[i] = Inf;
    int g = Get(i, n - 1);
    if (a[g] == lst[a[i]]) p[i] = g;
  }
  for (int i = 1; i < N; i++)
    for (int k = 0; k < K; k++)
      if (i & (1 << k)) Bit[i] = k;
  for (int i = 1; i <= m; i++) Min[i][0] = p[i];
  for (int k = 1; k < K; k++)
    for (int i = 1; i + (1 << k) - 1 <= m; i++)
      Min[i][k] = min(Min[i][k - 1], Min[i + (1 << (k - 1))][k - 1]);
  while (q--) {
    int x, y;
    scanf("%d%d", &x, &y);
    int Ans = GetMin(x, y);
    printf("%d", Ans <= y);
  }
}
