Submission #1120043

#TimeUsernameProblemLanguageResultExecution timeMemory
1120043sunboiAdvertisement 2 (JOI23_ho_t2)C++17
0 / 100
2085 ms4112 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...