Submission #1144966

#TimeUsernameProblemLanguageResultExecution timeMemory
1144966thecrazycandyTrampoline (info1cup20_trampoline)C++20
0 / 100
2092 ms10212 KiB
#include <bits/stdc++.h> //#pragma GCC optimize("Ofast") //#pragma GCC target("avx,avx2,fma") using namespace std; #define sped_up ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ll long long const ll INF = (ll)1e9 + 1, INFL = (ll)1e18 + 1; const ll mod = (ll)1e9 + 7, MAXN = (ll)0; int main () { sped_up; ll n, m, k; cin >> n >> m >> k; map <ll, vector <ll>> mp; for (int i = 1; i <= k; i++) { ll x, y; cin >> y >> x; mp[y].push_back(x); } for (auto i : mp) { sort(i.second.begin(), i.second.end()); } ll q; cin >> q; while (q--) { ll x1, y1, x2, y2; cin >> y1 >> x1 >> y2 >> x2; ll nwx = x1; ll nwy = y1; while (true) { ll no = 1; if (nwy == y2 && nwx <= x2) { cout << "Yes\n"; break; } else if (nwx > x2) { cout << "No\n"; break; } for (auto i : mp[nwy]) { if (nwx <= i) { nwx = i; no = 0; break; } } if (no == 1) { cout << "No\n"; break; } nwy++; } } }
#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...