#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
constexpr auto MOD = 1000000007LL;
constexpr auto LINF = (1LL << 60);
constexpr auto INF = 2147483647LL;
constexpr auto PI = 3.1415926535897932384626433;
constexpr auto EPS = 1E-9;
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> p) {
  out << p.first << ' ' << p.second;
  return out;
}
template <typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
  in >> p.first >> p.second;
  return in;
}
template <typename T>
istream &operator>>(istream &in, vector<T> &v) {
  for (auto &x : v) in >> x;
  return in;
}
template <typename T>
ostream &operator<<(ostream &out, vector<T> v) {
  for (int i = 0; i < v.size(); i++)
    out << v[i] << (i + 1 == v.size() ? '\n' : ' ');
  out.flush();
  return out;
}
int n, m, q;
int a[200010], ina[200010], b[200010], fa[20][200010], last[200010], rr[200010];
int getPrev(int x) {
  int i = ina[x] - 1;
  if (i < 0) i += n;
  return a[i];
}
void build() {
  for (int i = 1; i < 20; i++) {
    for (int j = 1; j <= m; j++) {
      fa[i][j] = fa[i - 1][fa[i - 1][j]];
    }
  }
  return;
}
int getfa(int x) {
  for (int i = 0; i < 20; i++) {
    if ((1 << i) & (n - 1)) {
      x = fa[i][x];
    }
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> q;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ina[a[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    fa[0][i] = last[getPrev(b[i])];
    last[b[i]] = i;
  }
  build();
  for (int i = 1; i <= m; i++) {
    rr[i] = getfa(i);
    rr[i] = max(rr[i - 1], rr[i]);
  }
  for (int i = 0, x, y; i < q; i++) {
    cin >> x >> y;
    cout << (rr[y] >= x);
  }
  cout << endl;
  return 0;
}
