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 ll long long
#define pii pair<int, int>
using namespace std;
const int MAX = 8e4 + 8;
set<int> colors[MAX];
int n, m;
int squares[MAX][4];
int points[MAX][3];
int main(){
cin >> n >> m;
for (int i = 0; i < n; i++)
{
cin >> squares[i][0] >> squares[i][1] >> squares[i][2] >> squares[i][3];
}
for (int i = 0; i < m; i++)
{
cin >> points[i][0] >> points[i][1] >> points[i][2];
}
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
if(squares[j][0] <= points[i][0] && squares[j][2] >= points[i][0] && squares[j][1] <= points[i][1] && squares[j][3] >= points[i][1]){
colors[j].insert(points[i][2]);
}
}
}
for (int i = 0; i < n; i++)
{
cout << colors[i].size() << '\n';
}
}
# | 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... |