Submission #1127774

#TimeUsernameProblemLanguageResultExecution timeMemory
112777412345678Gift Exchange (JOI24_ho_t4)C++20
10 / 100
24 ms2244 KiB
#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({a[i], b[i]}); sort(v.begin(), v.end()); cin>>q>>l>>r; for (int i=0; i<n-1; i++) { mx=max(mx, v[i].first); if (mx==2*(i+1)) return cout<<"No", 0; } cout<<"Yes"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...