# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
523706 | iskhakkutbilim | Trampoline (info1cup20_trampoline) | C++14 | 754 ms | 26144 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.
// Author: Tazhibaev Iskhak
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int, int> ,null_type,less< pair<int, int> >,rb_tree_tag,
tree_order_statistics_node_update> ordered_set;
const long double pi = acos((long double) - 1.0);
const double eps = (double)1e-9;
const int INF = 1e9 + 7;
#define ff first
#define ss second
#define ll long long
#define ld long double
#define pb push_back
void usaco( string filename){
freopen((filename+".in").c_str(), "r", stdin);
freopen((filename+".out").c_str(), "w", stdout);
}
int r, c, n;
int in(int i, int j){
if(i >= 1 and i <= r and j >= 1 and j <= c) return 1;
return 0;
}
main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
cin >> r >> c >> n;
ordered_set st;
ordered_set idx;
for(int i = 0;i < n; i++){
int x, y;
cin >> x >> y;
st.insert({x, y});
idx.insert({y, x});
}
int T;
cin >> T;
while(T--){
pair<int, int> start;
cin >> start.ff >> start.ss;
pair<int, int> end;
cin >> end.ff >> end.ss;
if(end.ff == start.ff and end.ss >= end.ff){
cout << "Yes" << "\n";
continue;
}else if(end.ff < start.ff ){
cout << "No" << "\n";
continue;
}else if(end.ss < start.ss){
cout << "No" << "\n";
continue;
}
int L = st.order_of_key(start);
int R = st.order_of_key(end);
int l = idx.order_of_key({start.ss, start.ff});
int r = idx.order_of_key({end.ss, end.ff});
// cout << L << " " << R << "\n";
if((R - L) >= end.ff - start.ff and r - l >= end.ff - start.ff){
cout << "Yes";
}else cout << "No";
cout << "\n";
}
return 0;
}
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... |