Describe your issue
This is my code for Rectangular Queries:
include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n = 0;
cin >> n;
vector<vector> a(n, vector(n, 0));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) cin >> a[i][j];
}
int q = 0;
cin >> q;
while (q–) {
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
set s;
for (int i = x1 - 1; i <= x2 - 1; ++i) {
for (int j = y1 - 1; j <= y2 - 1; ++j) s.insert(a[i][j]);
}
cout << s.size() << "\n";
}
return 0;
}