Submission #520537

#TimeUsernameProblemLanguageResultExecution timeMemory
520537WeeWeeTanTrampoline (info1cup20_trampoline)C++14
0 / 100
1 ms588 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int n, k, t; int a, b; vector<bool> green[2500]; int startx, starty, endx, endy; string move(int sx, int sy, int ex, int ey) { if (sx == ex and sy == ey) { return "Yes"; } else if (green[sx][sy]) { if (sx == ex) { return move(sx+1, sy, ex, ey); } return move(sx, sy+1, ex, ey); } else if (sy == ey) { return "No"; } else { return move(sx, sy+1, ex, ey); } } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> k; for (int i=0; i<n; i++) { cin >> a >> b; a--; b--; green[a][b] = true; } for (int i=0; i<t; i++) { cin >> startx >> starty >> endx >> endy; startx--; starty--; endx--; endy--; cout << move(startx, starty, endx, endy); } 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...