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>
using namespace std;
int main()
{
int n; cin >> n;
vector<pair<int, int>> a(n);
for (int i = 0; i < n; i++){
cin >> a[i].first >> a[i].second;
}
vector<int> color(n);
int cnt = 1;
for (int i = 0; i < n; i++){
if (color[i]) continue;
color[i] = cnt;
for (int j = 0; j < n; j++){
if (color[j]) continue;
if (abs(a[i].first - a[j].first) <= abs(a[i].second - a[j].second)){
color[j] = cnt;
}
}
cnt++;
}
cout << cnt - 1 << endl;
}
# | 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... |