Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- #include<cstring>
- #include<algorithm>
- using namespace std;
- int a[510][510] = { 0 };
- int main() {
- int n;
- int flag = 0;
- int judge, x1, x2, y1, y2;
- cin >> n;
- for (int x = 0; x < n; x++) {
- cin >> judge >> x1 >> y1 >> x2 >> y2;
- if (judge == 1) {
- for (int i = x1; i <= x2; i++) {
- for (int j = y1; j <= y2; j++) {
- if (a[i][j] == 0) {
- flag = 1;
- break;
- }
- }
- }
- if (flag == 1) {
- cout << "No" << endl;
- }
- else {
- cout << "Yes" << endl;
- }
- }
- else {
- for (int i = x1; i <= x2; i++) {
- for (int j = y1; j <= y2; j++) {
- a[i][j] = 1;
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement