#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 50;
int a[N], b[N], last[N], LOG[N];
int f[N][22], g[N][22];
unordered_map<int, int> mp;
int main() {
  int n, m, q;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    mp[a[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
    int T = mp[b[i]] - 1;
    if (T == 0) T = n;
    f[i][0] = last[a[T]];
    last[b[i]] = i;
  }
  for (int i = 1; (1 << i) <= n; i++)
    for (int j = 1; j <= m; j++) f[j][i] = max(f[j][i], f[f[j][i - 1]][i - 1]);
  for (int i = 1; i <= m; i++) {
    int L = n - 1, cur = i;
    for (int j = 20; j >= 0; j--)
      if (L - (1 << j) >= 0) L -= (1 << j), cur = f[cur][j];
    g[i][0] = cur;
  }
  for (int i = 1; (1 << i) <= m; i++)
    for (int j = 1; j + (1 << i) - 1 <= m; j++)
      g[j][i] = max(g[j][i - 1], g[j + (1 << (i - 1))][i - 1]);
  LOG[0] = -1;
  for (int i = 1; i <= m; i++) LOG[i] = LOG[i >> 1] + 1;
  string ans;
  while (q--) {
    int l, r;
    scanf("%d%d", &l, &r);
    int t = LOG[r - l + 1];
    if (max(g[l][t], g[r - (1 << t) + 1][t]) >= l)
      ans += '1';
    else
      ans += '0';
  }
  cout << ans << endl;
  return 0;
}
