#include <bits/stdc++.h>
const long long MAX_N = 2e5 + 10;
const long long MOD = 1e9 + 7;
using namespace std;
vector<int> g[MAX_N];
int rm[MAX_N][20];
vector<int> vers;
int a[MAX_N];
int b[MAX_N];
int t[MAX_N];
int pos[MAX_N];
int last[MAX_N];
int mark[MAX_N];
int n, m, q;
int ask(int l, int r) {
  int len = r - l + 1;
  int lg = log2(len);
  return min(rm[l][lg], rm[r - (1 << lg) + 1][lg]);
}
void dfs(int v) {
  if (vers.size() < n - 1)
    t[v] = 1e9;
  else if (n - 1)
    t[v] = vers[vers.size() - (n - 1)];
  vers.push_back(v);
  mark[v]++;
  for (auto x : g[v]) dfs(x);
  vers.pop_back();
}
int main() {
  cin >> n >> m >> q;
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i]), pos[b[i]] = i;
  for (int i = 1; i <= m; ++i) cin >> a[i], a[i] = pos[a[i]];
  for (int i = m; i > 0; --i) {
    if (last[(a[i] % n) + 1]) g[last[(a[i] % n) + 1]].push_back(i);
    last[a[i]] = i;
  }
  for (int i = m; i > 0; --i) {
    if (!mark[i]) dfs(i);
  }
  for (int i = 1; i <= m; ++i) rm[i][0] = t[i];
  for (int i = 1; i < 20; ++i)
    for (int j = 1; j <= m - (1 << i) + 1; ++j)
      rm[j][i] = min(rm[j][i - 1], rm[j + (1 << (i - 1))][i - 1]);
  vector<int> ans;
  while (q--) {
    int l, r;
    scanf("%d%d", &l, &r);
    if (ask(l, r) <= r)
      ans.push_back(1);
    else
      ans.push_back(0);
  }
  for (auto x : ans) cout << x;
  return 0;
}
