#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9;
const long long maxn = 2e5 + 123;
const long long N = 2e5 + 123;
std::vector<pair<long long, pair<long long, long long>>> ve[maxn];
std::vector<pair<long long, long long>> v[maxn];
std::vector<int> nxt[maxn];
int n, m, q;
int r[N], s[N], pre[N], pos[N], answer[N];
int p[N][22];
void init() {
  cin >> n >> m >> q;
  for (int i = 1; i <= n; i++) cin >> r[i];
  for (int i = 1; i <= n; i++) pre[r[i % n + 1]] = r[i];
  for (int i = 1; i <= m; i++) cin >> s[i];
  for (int i = 1; i <= m; i++) {
    p[i][0] = pos[pre[s[i]]];
    pos[s[i]] = i;
  }
  for (int j = 1; j <= 18; j++)
    for (int i = 1; i <= m; i++) p[i][j] = p[p[i][j - 1]][j - 1];
  for (int i = 1; i <= m; i++) {
    int x = i;
    for (int j = 0; j <= 18; j++)
      if ((n - 1) & (1 << j)) x = p[x][j];
    answer[i] = max(answer[i - 1], x);
  }
}
void solve() {
  for (int i = 1; i <= q; i++) {
    int l, r;
    cin >> l >> r;
    if (answer[r] >= l)
      printf("1");
    else
      printf("0");
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  init();
  solve();
  return 0;
}
