#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int mod = 1e9 + 7;
long long qpow(long long a, long long b) {
  long long res = 1;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
struct graph {
  int head[maxn], nxt[maxn << 1], to[maxn << 1], w[maxn << 1], sz;
  void init() { memset(head, -1, sizeof(head)); }
  graph() { init(); }
  void push(int a, int b, int c) {
    nxt[sz] = head[a], to[sz] = b, w[sz] = c, head[a] = sz++;
  }
  int& operator[](const int a) { return to[a]; }
};
int a[maxn], b[maxn];
int pre[maxn][20], pos[maxn], last[maxn], mx[maxn];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), pos[a[i]] = i;
  for (int i = 1; i <= m; ++i) scanf("%d", &b[i]);
  for (int i = 1; i <= m; ++i) {
    int tmp = pos[b[i]];
    tmp--;
    if (tmp == 0) tmp = n;
    pre[i][0] = last[a[tmp]];
    last[b[i]] = i;
  }
  for (int i = 1; i <= 19; ++i) {
    for (int j = 1; j <= m; ++j) {
      pre[j][i] = pre[pre[j][i - 1]][i - 1];
    }
  }
  for (int i = 1; i <= m; ++i) {
    int now = i;
    for (int j = 18; j >= 0; --j) {
      if ((n - 1) >> j & 1) {
        now = pre[now][j];
      }
    }
    mx[i] = max(now, mx[i - 1]);
  }
  vector<bool> ans;
  while (k--) {
    int l, r;
    scanf("%d%d", &l, &r);
    ans.push_back((l <= mx[r]));
  }
  for (auto i : ans) cout << i;
  return 0;
}
