#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
const long long LLINF = 1e18 + 7;
const int MX = 1e9 + 5;
vector<int> perm(200009);
vector<int> inv(200009);
vector<int> tab(200009);
vector<vector<int>> nxt(200009);
vector<int> last(200009), best(200009);
int n;
int makebest(int i) {
  int k = n - 1;
  for (int b = 17; b >= 0; b--) {
    if (k & (1 << b)) {
      i = nxt[i][b];
      if (i == MX) return MX;
    }
  }
  return i;
}
int main() {
  int m, q;
  cin >> n >> m >> q;
  for (int i = 1; i < 200009; i++) last[i] = MX;
  for (int i = 1; i <= n; i++) {
    cin >> perm[i];
    inv[perm[i]] = i;
  }
  perm[n + 1] = perm[1];
  for (int i = 1; i <= m; i++) cin >> tab[i];
  for (int i = 1; i <= m; i++) nxt[i].resize(19);
  for (int i = m; i > 0; i--) {
    nxt[i][0] = last[perm[inv[tab[i]] + 1]];
    last[tab[i]] = i;
  }
  for (int i = 1; i < 18; i++) {
    for (int j = 1; j <= m; j++) {
      nxt[j][i] = nxt[j][i - 1] > m ? MX : nxt[nxt[j][i - 1]][i - 1];
    }
  }
  for (int i = 1; i <= m; i++) {
    best[i] = makebest(i);
  }
  int mini = MX;
  for (int i = m; i > 0; i--) {
    mini = min(mini, best[i]);
    best[i] = mini;
  }
  string s;
  while (q--) {
    int l, r;
    cin >> l >> r;
    s += r >= best[l] ? '1' : '0';
  }
  cout << s << '\n';
}
