#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (auto i : v) os << i << " ";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& v) {
  for (auto i : v) os << i << " ";
  return os;
}
const int N = 2e5 + 233;
int dp[N][20], lst[N], nxt[N], ans[N], a[N], b[N];
int main() {
  int n, m, t;
  scanf("%d%d%d", &n, &m, &t);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  for (int i = 1; i <= n; ++i) {
    nxt[a[i - 1]] = a[i];
    lst[i] = m + 1;
  }
  nxt[a[n]] = a[1];
  for (int i = 1; i <= m; ++i) scanf("%d", b + i);
  for (int i = 0; i < 20; ++i) dp[m + 1][i] = m + 1;
  ans[m + 1] = m + 1;
  for (int i = m; i; --i) {
    dp[i][0] = lst[nxt[b[i]]];
    lst[b[i]] = i;
    for (int j = 1; j < 20; ++j) dp[i][j] = dp[dp[i][j - 1]][j - 1];
    int cnt = n - 1;
    int p = i;
    for (int j = 19; j + 1; --j)
      if (cnt >= (1 << j)) {
        cnt -= (1 << j);
        p = dp[p][j];
      }
    ans[i] = min(ans[i + 1], p);
  }
  while (t--) {
    int l, r;
    scanf("%d%d", &l, &r);
    if (ans[l] <= r)
      printf("1");
    else
      printf("0");
  }
  return 0;
}
