Submission #522144

#TimeUsernameProblemLanguageResultExecution timeMemory
522144maks007Trampoline (info1cup20_trampoline)C++14
73 / 100
2097 ms21656 KiB
#include <bits/stdc++.h> using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; map <int,vector <int>> a; int q; cin >> q; vector <pair <int,int>> temp; while(q --) { int x, y; cin >> x >> y; x --; y --; temp.push_back({x, y}); } sort(temp.begin(), temp.end()); for(int i = 0; i < temp.size(); i ++) { a[temp[i].first].push_back(temp[i].second); } cin >> q; while(q --) { int startx, starty, endx, endy; cin >> startx >> starty >> endx >> endy; startx --; starty --; endx --; endy --; while(startx != endx) { auto it = lower_bound(a[startx].begin(), a[startx].end(), starty); if(it == a[startx].end()) { goto end; } startx ++; starty = *it; } if(startx == endx and starty <= endy){ cout << "Yes\n"; }else cout << "No\n"; continue; end:; cout << "No\n"; } return false; }

Compilation message (stderr)

trampoline.cpp: In function 'int main()':
trampoline.cpp:22:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |  for(int i = 0; i < temp.size(); i ++) {
      |                 ~~^~~~~~~~~~~~~
#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...