Submission #524681

#TimeUsernameProblemLanguageResultExecution timeMemory
524681gagik_2007Trampoline (info1cup20_trampoline)C++17
0 / 100
93 ms5848 KiB
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <cmath> #include <ctime> #include <set> #include <map> #include <stack> #include <queue> #include <deque> #include <limits> #include <iomanip> #include <unordered_set> #include <unordered_map> using namespace std; typedef long long ll; typedef long double ld; typedef unordered_multiset<ll> whydoweneedunorderedmultiset; #define ff first #define ss second #define esle else ll ttt; const ll INF = 1e18; const ll MOD = 1e9 + 7; const ll N = 9; ll l, r, k, n, m; vector<int> g[100007]; int main() { cin >> k >> m >> n; for (int i = 0; i < n; i++) { ll x, y; cin >> x >> y; g[x].push_back(y); } cin >> ttt; while (ttt--) { ll xs, ys, xe, ye; cin >> xs >> ys >> xe >> ye; if (xs == xe) { cout << "YES" << endl; } else if (xs > xe || ys > ye) { cout << "NO" << endl; } else { ll cur_y = ys; ll cur_x = xs; bool ok = true; while (cur_x != xe && cur_y <= ye) { auto it = lower_bound(g[cur_x].begin(), g[cur_x].end(), cur_y); if (it == g[cur_x].end()) { ok = false; break; } else { cur_y = *it; } cur_x++; } ok = ok && (cur_y <= ye); if (ok) { cout << "YES" << endl; } else cout << "NO" << endl; } } return 0; }
#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...