This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
using namespace std;
typedef long long ll;
const int N = 80100;
const int oo = 2e9;
unordered_set<int> st;
int a[N], b[N], c[N], d[N], n, m, x[N], y[N], k[N];
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL
freopen("in.txt","r",stdin);
#endif // _LOCAL
cin >> n >> m;
for (int i = 0; i < n; i++)
cin >> a[i] >> b[i] >> c[i] >> d[i];
for (int i = 0; i < m; i++)
cin >> x[i] >> y[i] >> k[i];
for (int i = 0; i < n; i++){
int ans = 0;
st.clear();
for (int j = 0; j < m; j++)
if (a[i] <= x[j] && c[i] >= x[j] && b[i] <= y[j] && d[i] >= y[j] &&
st.find(k[j]) == st.end()){
ans++;
st.insert(k[j]);
}
cout << ans << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |