#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const long long mod = 1000000007;
int n, m, q, p[200005], a[200009], val[200009], sparse[200009][20], lg[200009],
    pos[200009], vis[200009];
vector<int> id[200009];
vector<int> v[200009];
void sp_cal() {
  for (int j = 0; j <= lg[m]; j++)
    for (int i = 0; i + (1 << j) - 1 < m; i++)
      if (j == 0)
        sparse[i][j] = val[i];
      else
        sparse[i][j] = min(sparse[i][j - 1], sparse[i + (1 << (j - 1))][j - 1]);
}
int solve(int l, int r) {
  int len = lg[r - l + 1];
  return min(sparse[l][len], sparse[r - (1 << len) + 1][len]);
}
vector<int> nodes;
void dfs(int node) {
  vis[node]++;
  nodes.push_back(node);
  if (nodes.size() >= n) {
    int z = nodes.size();
    val[nodes.back()] = nodes[z - n];
  }
  for (auto i : v[node])
    if (!vis[i]) dfs(i);
  nodes.pop_back();
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  lg[1] = 0;
  for (int i = 2; i <= 2e5 + 5; i++) lg[i] = lg[i / 2] + 1;
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    pos[p[i]] = i;
  }
  for (int i = 0; i < m; i++) cin >> a[i], id[a[i]].push_back(i);
  for (int i = 0; i < m; i++) {
    val[i] = 1e9;
    int my_next = p[(pos[a[i]] + 1) % n];
    int ind = upper_bound(id[my_next].begin(), id[my_next].end(), i) -
              id[my_next].begin();
    if (ind < id[my_next].size()) {
      int par = id[my_next][ind];
      v[par].push_back(i);
    }
  }
  memset(vis, 0, sizeof vis);
  for (int i = m - 1; i >= 0; i--)
    if (!vis[i]) dfs(i);
  sp_cal();
  while (q--) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    cout << (solve(l, r) <= r ? 1 : 0);
  }
  return 0;
}
