# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
691757 | Aiperiii | Trampoline (info1cup20_trampoline) | C++14 | 2027 ms | 11788 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
int r,c,n;
cin>>r>>c>>n;
map <int,vector <long long > > mp;
while(n--){
int x,y;
cin>>x>>y;
mp[x].push_back(y);
}
for(auto x : mp){
vector <long long > vec=x.second;
sort(vec.begin(),vec.end());
mp[x.first]=vec;
}
int t;
cin>>t;
while(t--){
int x1,x2,y1,y2;
cin>>x1>>y1>>x2>>y2;
string ans="Yes";
if(x1>x2 or y1>y2){
ans="No";
}
int y=y1;
for(int i=x1;i<x2;i++){
vector < long long > vec=mp[i];
if(vec.size()==0){
ans="No";
break;
}
vec.insert(vec.begin(),-2e9);
vec.push_back(2e9);
long long l=0;
long long r=vec.size();
while(r-l>1){
long long mid=(l+r)/2;
if(vec[mid]<y){
l=mid;
}
else{
r=mid;
}
}
if(r==vec.size()-1 ){
ans="No";
break;
}
else {
y=vec[r];
}
}
if(y>y2){
ans="No";
}
cout<<ans<<endl;
}
}
Compilation message (stderr)
# | 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... |