제출 #487894

#제출 시각아이디문제언어결과실행 시간메모리
487894maks007Trampoline (info1cup20_trampoline)C++14
23 / 100
2118 ms1048580 KiB
#include <bits/stdc++.h>

using namespace std;

void solve() {
	int n, m, green;
	cin >> n >> m >> green;
	vector <vector <int>> a(n + 1, vector <int> (m + 1, 1));
	for(int i = 0; i < green; i ++) {
		int x, y;
		cin >> x >> y;
		a[x - 1][y - 1] = 2;
	}
	int q;
	cin >> q;
	while(q --) {
		pair <int, int> start, end;
		cin >> start.first >> start.second;
		cin >> end.first >> end.second; 
		start.first --;
		start.second --;
		end.first --;
		end.second --;
		vector <vector <int>> ans(n + 1, vector <int> (m + 1, 0));
		ans[start.first][start.second] = 1;
		for(int i = start.first; i <= end.first; i ++) {
			for(int j = start.second; j <= end.second; j ++){

				
				ans[i][j + 1] = max(ans[i][j], ans[i][j + 1]);
				if(a[i][j] == 2) {
					ans[i+1][j] = max(ans[i][j], ans[i + 1][j]);
				} 
			}
		}
		if(ans[end.first][end.second] == 1) cout << "Yes\n";
		else cout << "No\n";
		end:;
	}
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int Q = 1;
	//cin >> Q;
	while (Q --) {
		solve();
	}
	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

trampoline.cpp: In function 'void solve()':
trampoline.cpp:38:3: warning: label 'end' defined but not used [-Wunused-label]
   38 |   end:;
      |   ^~~
#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...