#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, m, q;
int fro[N], pre[N][25], rec[N], mx[N];
int a[N], b[N], rt[N];
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    fro[a[i]] = a[i - 1];
  }
  fro[a[1]] = a[n];
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &b[i]);
    pre[i][0] = rec[fro[b[i]]], rec[b[i]] = i;
    for (int j = 1; j <= 20; ++j) pre[i][j] = pre[pre[i][j - 1]][j - 1];
    int pos = i;
    for (int j = 20; j >= 0; --j)
      if ((1 << j) & (n - 1)) {
        pos = pre[pos][j];
      }
    mx[i] = max(mx[i - 1], pos);
  }
  for (int i = 1, x, y; i <= q; ++i) {
    scanf("%d%d", &x, &y);
    printf("%d", mx[y] >= x);
  }
  return 0;
}
