#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int INF = 0x3f3f3f3f;
int a[N], b[N];
int la[N];
int n, m, q;
int pre[N];
int dp[N][20];
int p[N];
int t;
int res[N];
int solve(int x) {
  int now = n - 1;
  int ans = x;
  for (int i = t; i >= 0; i--) {
    if (p[i] <= now) {
      ans = dp[ans][i];
      now -= p[i];
    }
  }
  return ans;
}
void init() {
  for (int i = n; i >= 2; i--) {
    pre[a[i]] = a[i - 1];
  }
  pre[a[1]] = a[n];
}
int main() {
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  init();
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
  }
  t = (int)(log(n) / log(2)) + 1;
  p[0] = 1;
  for (int i = 1; i <= t; i++) {
    p[i] = p[i - 1] * 2;
  }
  for (int i = 1; i <= m; i++) {
    dp[i][0] = la[pre[b[i]]];
    for (int j = 1; j <= t; j++) {
      dp[i][j] = dp[dp[i][j - 1]][j - 1];
    }
    la[b[i]] = i;
  }
  int pos;
  for (int i = 1; i <= m; i++) {
    pos = solve(i);
    res[i] = max(res[i - 1], pos);
  }
  int l, r;
  string s;
  while (q--) {
    cin >> l >> r;
    if (res[r] >= l)
      s += "1";
    else
      s += "0";
  }
  cout << s << endl;
  return 0;
}
