Submission #714643

#TimeUsernameProblemLanguageResultExecution timeMemory
714643ToxtaqPlahte (COCI17_plahte)C++17
0 / 160
2069 ms458368 KiB
#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'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...