#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int grand(int x) { return uniform_int_distribution<int>(0, x - 1)(rng); }
long long gcd(long long x, long long y) {
  if (x < y) return gcd(y, x);
  if (y == 0) return x;
  return gcd(y, x % y);
}
const long long mod = 1e9 + 7;
long long modexp(long long x, long long ex) {
  long long ans = 1ll;
  while (ex > 0) {
    if (ex & 1ll) ans = (ans * x) % mod;
    ex >>= 1ll;
    x = (x * x) % mod;
  }
  return ans;
}
const int maxn = 2e5 + 7;
const int lmx = 18;
const long long inf = 1e9 + 7;
int p[maxn];
int pos[maxn];
int ls[maxn];
int f[maxn][lmx];
int g[maxn];
int second[maxn * 4];
void init(int x, int l, int r) {
  if (l == r) {
    second[x] = g[l];
    return;
  }
  int m = (l + r) / 2;
  init(x + x, l, m);
  init(x + x + 1, m + 1, r);
  second[x] = max(second[x + x], second[x + x + 1]);
}
int qry(int x, int l, int r, int i, int j) {
  if (j < l || r < i) return 0;
  if (i <= l && r <= j) return second[x];
  int m = (l + r) / 2;
  return max(qry(x + x, l, m, i, j), qry(x + x + 1, m + 1, r, i, j));
}
int main() {
  {
    ios ::sync_with_stdio(false);
    cin.tie(0);
  };
  int n, m, q;
  cin >> n >> m >> q;
  for (int j = 1; j <= n; j++) {
    cin >> p[j];
    pos[p[j]] = j;
  }
  fill(ls, ls + maxn, 0);
  for (int j = 1; j <= m; j++) {
    int z;
    cin >> z;
    int x = pos[z], y;
    if (x == 1)
      y = n;
    else
      y = x - 1;
    f[j][0] = ls[p[y]];
    ;
    ls[z] = j;
  };
  for (int j = 1; j < lmx; j++) {
    for (int i = 1; i <= m; i++) {
      if (f[i][j - 1] == 0)
        f[i][j] = 0;
      else
        f[i][j] = f[f[i][j - 1]][j - 1];
    }
  }
  for (int j = 1; j <= m; j++) g[j] = j;
  for (int b = lmx - 1; b >= 0; b--) {
    if ((n - 1) & (1 << b)) {
      for (int j = 1; j <= m; j++) {
        if (g[j] == 0) continue;
        g[j] = f[g[j]][b];
      }
    }
  };
  init(1, 1, m);
  while (q--) {
    int l, r;
    cin >> l >> r;
    int z = qry(1, 1, m, l, r);
    if (z >= l)
      cout << 1;
    else
      cout << 0;
  }
  cout << "\n";
}
