#include <bits/stdc++.h>
using namespace std;
istream& in = cin;
int n, m, q;
int a[200010];
int b[200010];
pair<int, int> Q[200010];
int ne[200010];
void input() {
  in >> n >> m >> q;
  for (int i = 1; i <= n; ++i) {
    in >> a[i];
  }
  for (int i = 1; i <= m; ++i) {
    in >> b[i];
  }
  for (int i = 1; i <= q; ++i) {
    in >> Q[i].first >> Q[i].second;
  }
}
vector<int> edge[200010];
int dp[200010];
vector<int> ret;
int h[200010];
int E[200010];
vector<int> path;
bool vis[200010];
void dfs(int p) {
  if (vis[p]) return;
  vis[p] = 1;
  path.push_back(p);
  if (path.size() >= n) {
    E[p] = path[path.size() - n];
  }
  for (int son : edge[p]) {
    dfs(son);
  }
  path.pop_back();
}
int main() {
  ret.resize(200010);
  int TEST_CASE = 1;
  while (TEST_CASE-- > 0) {
    input();
    for (int i = 1; i <= m; ++i) {
      edge[i].clear();
      dp[i] = -1;
    }
    a[0] = a[n];
    a[n + 1] = a[1];
    for (int i = 1; i <= n; ++i) {
      ne[a[i]] = a[i + 1];
    }
    for (int i = m; i >= 1; --i) {
      h[b[i]] = i;
      int pp = ne[b[i]];
      if (h[pp]) {
        edge[h[pp]].push_back(i);
      }
    }
    for (int i = 0; i <= m + 1; ++i) {
      E[i] = 1e7;
    }
    for (int i = m; i >= 1; --i) {
      dfs(i);
      E[i] = min(E[i], E[i + 1]);
    }
    for (int i = 1; i <= q; ++i) {
      int l = Q[i].first;
      int r = Q[i].second;
      if (r >= E[l]) {
        cout << "1";
      } else {
        cout << "0";
      }
    }
    cout << endl;
  }
  return 0;
}
