#include <bits/stdc++.h>
using namespace std;
const long long INF = 2147483647;
const long long MOD = 1000000007;
const long long mod = 998244353;
const long double eps = 1e-12;
long long n, m, q;
long long perm[200001];
long long arr[200001];
long long nextperm[200001];
set<long long> pos[200001];
long long dp[200001][20];
long long ed[200001];
struct Node {
  long long sl, sr;
  long long Min;
};
Node st[800001];
void build(long long cidx, long long cl, long long cr) {
  st[cidx].sl = cl;
  st[cidx].sr = cr;
  if (cl < cr) {
    long long mid = (cl + cr) / 2;
    build(cidx * 2, cl, mid);
    build(cidx * 2 + 1, mid + 1, cr);
    st[cidx].Min = min(st[cidx * 2].Min, st[cidx * 2 + 1].Min);
  } else {
    st[cidx].Min = ed[cl];
  }
}
long long query(long long cidx, long long ql, long long qr) {
  long long cl = st[cidx].sl;
  long long cr = st[cidx].sr;
  if (qr < cl or cr < ql) return INF;
  if (ql <= cl and cr <= qr) return st[cidx].Min;
  return min(query(cidx * 2, ql, qr), query(cidx * 2 + 1, ql, qr));
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  for (long long i = 0; i < n; i++) {
    cin >> perm[i];
    perm[i]--;
  }
  for (long long i = 0; i < m; i++) {
    cin >> arr[i];
    arr[i]--;
  }
  for (long long i = 0; i < n; i++) {
    nextperm[perm[i]] = perm[(i + 1) % n];
  }
  for (long long i = 0; i < m; i++) {
    pos[arr[i]].insert(i);
  }
  for (long long i = 0; i < n; i++) {
    pos[i].insert(INF);
  }
  for (long long i = 0; i < m; i++) {
    dp[i][0] = *(pos[nextperm[arr[i]]].lower_bound(i + 1));
  }
  for (long long j = 1; j <= 19; j++) {
    for (long long i = 0; i < m; i++) {
      if (dp[i][j - 1] == INF)
        dp[i][j] = INF;
      else
        dp[i][j] = dp[dp[i][j - 1]][j - 1];
    }
  }
  for (long long i = 0; i < m; i++) {
    long long dis = n - 1;
    long long ptr = i;
    for (long long j = 0; j <= 19; j++) {
      if ((dis & (1 << j)) != 0) {
        if (ptr == INF) continue;
        ptr = dp[ptr][j];
      }
    }
    ed[i] = ptr;
  }
  build(1, 0, m - 1);
  long long ql, qr;
  while (q--) {
    cin >> ql >> qr;
    ql--;
    qr--;
    if (query(1, ql, qr) <= qr)
      cout << 1;
    else
      cout << 0;
  }
  cout << endl;
  return 0;
}
