#include <bits/stdc++.h>
using namespace std;
int p[200500];
int ysugfs[200500];
int ysugfawfsds[200500];
int whnext[200500];
int a[200500];
vector<pair<int, int> > qu;
int ans[200500];
pair<int, int> dp[200500];
int was[200500];
inline int read() {
  int u;
  scanf("%d", &u);
  return u;
}
int L[200500];
int wh2[200500][22];
int main() {
  int n = read();
  int m = read();
  int q = read();
  for (int i = 0; i < n; i++) {
    p[i] = read();
    if (i) {
      ysugfs[p[i]] = p[i - 1];
      ysugfawfsds[p[i - 1]] = p[i];
    }
  }
  ysugfs[p[0]] = p[n - 1];
  ysugfawfsds[p[n - 1]] = p[0];
  L[0] = 0;
  for (int i = 1; i <= m; i++) {
    a[i] = read();
    was[a[i]] = i;
    int u = ysugfs[a[i]];
    wh2[i][0] = was[u];
    for (int j = 1; j < 20; j++) {
      wh2[i][j] = wh2[wh2[i][j - 1]][j - 1];
    }
    int d = n - 1, po = 19, now = i;
    ;
    while (d) {
      if ((1 << po) <= d) {
        d -= (1 << po);
        now = wh2[now][po];
      }
      --po;
    }
    L[i] = max(L[i - 1], now);
  }
  while (q--) {
    int l = read();
    int r = read();
    cout << (l <= L[r]);
  }
  return 0;
}
