Submission #520537

# Submission time Handle Problem Language Result Execution time Memory
520537 2022-01-30T08:42:29 Z WeeWeeTan Trampoline (info1cup20_trampoline) C++14
0 / 100
1 ms 588 KB
#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 time Memory Grader output
1 Runtime error 1 ms 588 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 556 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 588 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 588 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 588 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -