#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7, Log = 18;
int perm[N], arr[N], Next[N], pos[N], jump[19][N], nrst[N];
string res = "";
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, q, l, r;
  cin >> n >> m >> q;
  for (int i = 0; i++ < n;) cin >> perm[i];
  for (int i = 0; i++ < m;) cin >> arr[i];
  Next[perm[n]] = perm[1], jump[0][m + 1] = m + 1, pos[n] = m + 1;
  for (int i = n; --i;) Next[perm[i]] = perm[i + 1], pos[i] = m + 1;
  for (int i = m + 1; --i;)
    jump[0][i] = pos[Next[arr[i]]], pos[arr[i]] = i, nrst[i] = i;
  for (int i = 0; i++ < Log;)
    for (int j = 0; j++ < m + 1;) jump[i][j] = jump[i - 1][jump[i - 1][j]];
  for (int i = Log + 1; i--;)
    if ((1 << i) & (n - 1))
      for (int j = 0; j++ < m;) nrst[j] = jump[i][nrst[j]];
  for (int i = m; --i;)
    if (nrst[i + 1] < nrst[i]) nrst[i] = nrst[i + 1];
  for (; q--;) {
    cin >> l >> r;
    res += (nrst[l] <= r ? '1' : '0');
  }
  cout << res;
  return 0;
}
