#include <bits/stdc++.h>
using namespace std;
struct Rectangle{
int x1, y1, x2, y2;
};
struct Point{
int x, y, color_id;
};
bool IsInside(Point p, Rectangle r){
return (p.x >= r.x1 && p.x <= r.x2 && p.y >= r.y1 && p.y <= r.y2);
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<Rectangle>rectangles(n);
for(int i = 0;i < n;++i){
cin >> rectangles[i].x1 >> rectangles[i].y1 >> rectangles[i].x2 >> rectangles[i].y2;
}
vector<Point>points(m);
for(int i = 0;i < m;++i){
cin >> points[i].x >> points[i].y >> points[i].color_id;
}
vector<set<int>>num_of_diff_colors(n);
for(int i = 0;i < m;++i){
for(int j = 0;j < n;++j){
if(IsInside(points[i], rectangles[j])){
num_of_diff_colors[j].insert(points[i].color_id);
}
}
}
for(int i = 0;i < n;++i){
cout << num_of_diff_colors[i].size() << '\n';
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2055 ms |
177988 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2036 ms |
300892 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2069 ms |
437284 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2068 ms |
458368 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
2051 ms |
379092 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |