#include <bits/stdc++.h>
using namespace std;
int tab[1000007], G[1000007], M[1000007], jump[1000007][19], odp[1000007],
    Min[1000007];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, q;
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) cin >> tab[i];
  for (int i = 0; i < n; i++) {
    M[i + 1] = m + 1;
    if (i == n - 1)
      G[tab[n - 1]] = tab[0];
    else
      G[tab[i]] = tab[i + 1];
  }
  for (int i = 0; i < m; i++) cin >> tab[i + 1];
  jump[m + 1][0] = m + 1;
  odp[m + 1] = m + 1;
  for (int i = m; i > 0; i--) {
    odp[i] = i;
    M[tab[i]] = i;
    jump[i][0] = M[G[tab[i]]];
  }
  for (int i = 1; i < 19; i++) {
    for (int j = 1; j <= m + 1; j++) {
      jump[j][i] = jump[jump[j][i - 1]][i - 1];
    }
  }
  int bin = n - 1;
  int pot = 19;
  while (bin > 0) {
    if (((1 << pot) & (bin)) > 0) {
      for (int i = 1; i <= m; i++) {
        odp[i] = jump[odp[i]][pot];
      }
      bin -= (1 << pot);
    }
    pot--;
  }
  int minW = m + 1;
  for (int i = m; i > 0; i--) {
    minW = min(minW, odp[i]);
    Min[i] = minW;
  }
  int a, b;
  for (int i = 0; i < q; i++) {
    cin >> a >> b;
    if (Min[a] <= b)
      cout << 1;
    else
      cout << 0;
  }
}
