#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T abs(T zz) {
  return zz < 0 ? -zz : zz;
}
template <typename T>
inline T sqr(T zz) {
  return zz * zz;
}
const int N = 200500;
const int L = 20;
int n, m, q;
int a[N];
int p[N], rp[N];
int pos[N];
int nx[L][N];
int dp[N];
int tr[4 * N];
void build(int idx, int lf, int rg) {
  if (lf == rg) {
    tr[idx] = dp[lf];
  } else {
    int mid = (lf + rg) / 2;
    build(2 * idx + 1, lf, mid);
    build(2 * idx + 2, mid + 1, rg);
    tr[idx] = min(tr[2 * idx + 1], tr[2 * idx + 2]);
  }
}
int get_min(int qlf, int qrg, int idx, int lf, int rg) {
  if (qlf == lf && qrg == rg) {
    return tr[idx];
  } else {
    int mid = (lf + rg) / 2;
    int ans = N;
    if (qlf <= mid) {
      ans = min(ans, get_min(qlf, min(mid, qrg), 2 * idx + 1, lf, mid));
    }
    if (mid + 1 <= qrg) {
      ans = min(ans, get_min(max(mid + 1, qlf), qrg, 2 * idx + 2, mid + 1, rg));
    }
    return ans;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m >> q;
  for (int i = (0); i < (n); ++i) {
    cin >> p[i];
    p[i]--;
    rp[p[i]] = i;
  }
  for (int i = (0); i < (m); ++i) {
    cin >> a[i];
    a[i]--;
  }
  {
    memset(pos, -1, sizeof(pos));
    for (int i = m - 1; i >= 0; --i) {
      nx[0][i] = pos[p[(rp[a[i]] + 1) % n]];
      pos[a[i]] = i;
    }
    for (int i = 1; i < L; ++i) {
      for (int j = 0; j < m; ++j) {
        if (nx[i - 1][j] == -1) {
          nx[i][j] = -1;
        } else {
          nx[i][j] = nx[i - 1][nx[i - 1][j]];
        }
      }
    }
  }
  for (int i = (0); i < (m); ++i) {
    int pos = i;
    int left = n - 1;
    for (int j = L - 1; j >= 0; j--) {
      if ((1 << j) <= left) {
        pos = nx[j][pos];
        left -= (1 << j);
        if (pos == -1) {
          break;
        }
      }
    }
    if (pos == -1) {
      dp[i] = N;
    } else {
      dp[i] = pos;
    }
  }
  build(0, 0, m - 1);
  string ans;
  ans.reserve(q);
  for (int i = (0); i < (q); ++i) {
    int lf, rg;
    cin >> lf >> rg;
    lf--;
    rg--;
    int dp_min = get_min(lf, rg, 0, 0, m - 1);
    if (dp_min <= rg) {
      ans.push_back('1');
    } else {
      ans.push_back('0');
    }
  }
  cout << ans << endl;
  return 0;
}
