#include <bits/stdc++.h>
using namespace std;
const int nx=1e5+5;
int n, q, a[nx], b[nx], l, r, mx;
vector<pair<int, int>> v;
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n;
for (int i=1; i<=n; i++) cin>>a[i];
for (int i=1; i<=n; i++) cin>>b[i], v.push_back({b[i], a[i]});
sort(v.begin(), v.end());
cin>>q>>l>>r;
for (int i=0; i<n-1; i++)
{
mx=max(mx, v[i].second);
if (mx==2*(i+1)) return cout<<"No", 0;
}
cout<<"Yes";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |