#include <bits/stdc++.h>
using namespace std;
long long int mul(long long int x, long long int y) {
  long long int ans = 1;
  while (y > 0) {
    if (y & 1) ans = (ans * x) % 1000000007;
    y /= 2;
    x = (x * x) % 1000000007;
  }
  return ans;
};
const long long int N = 200005;
long long int p[N], mm[N], last[N], a[N], ans[N], n;
vector<long long int> v[N];
vector<long long int> st;
void dfs(long long int x) {
  long long int size = v[x].size(), i;
  st.push_back(x);
  long long int ln = st.size();
  if (ln >= n)
    ans[x] = st[ln - n];
  else
    ans[x] = 1000000007;
  for (i = 0; i < size; i++) dfs(v[x][i]);
  st.pop_back();
  return;
}
int main() {
  long long int m, q, i, af;
  scanf("%lld", &n);
  scanf("%lld", &m);
  scanf("%lld", &q);
  for (i = 1; i <= n; i++) scanf("%lld", &p[i]), mm[p[i - 1]] = p[i];
  mm[p[n]] = p[1];
  for (i = 1; i <= m; i++) scanf("%lld", &a[i]);
  for (i = m; i >= 1; i--) {
    af = mm[a[i]];
    if (last[af] != 0) v[last[af]].push_back(i);
    last[a[i]] = i;
  }
  memset(ans, -1, sizeof ans);
  for (i = m; i >= 1; i--)
    if (ans[i] == -1) dfs(i);
  for (i = m - 1; i >= 1; i--) ans[i] = min(ans[i], ans[i + 1]);
  string str;
  while (q--) {
    long long int l, r;
    scanf("%lld", &l);
    scanf("%lld", &r);
    if (ans[l] <= r)
      str += '1';
    else
      str += '0';
  }
  cout << str << "\n";
  return 0;
}
