#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
int a[maxn];
int b[maxn];
int pre[maxn];
int pos[maxn];
int f[maxn][20];
int ans[maxn];
int l, r;
int n, m, q;
int main() {
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    pre[a[i % n + 1]] = a[i];
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
  }
  for (int i = 1; i <= m; i++) {
    f[i][0] = pos[pre[b[i]]];
    pos[b[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j < 20; j++) {
      f[i][j] = f[f[i][j - 1]][j - 1];
    }
  }
  for (int i = 1; i <= m; i++) {
    int x = i;
    for (int j = 0; j < 20; j++) {
      if ((n - 1) & (1 << j)) {
        x = f[x][j];
      }
    }
    ans[i] = max(ans[i - 1], x);
  }
  for (int i = 0; i < q; i++) {
    scanf("%d%d", &l, &r);
    if (l <= ans[r])
      printf("1");
    else
      printf("0");
  }
}
