Submission #1131793

#TimeUsernameProblemLanguageResultExecution timeMemory
1131793lopkusAdvertisement 2 (JOI23_ho_t2)C++20
59 / 100
2095 ms3396 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector<pair<int,int>> a(n + 1); for(int i = 1; i <= n; i++) { cin >> a[i].first >> a[i].second; swap(a[i].first, a[i].second); } sort(a.begin() + 1, a.end()); vector<int> u(n + 1); iota(u.begin() + 1, u.end(), 1); for(int i = 1; i <= n; i++) { for(int j = i + 1; j <= n; j++) { if(abs(a[i].second - a[j].second) <= a[j].first - a[i].first) { u[i] = j; } } } set<int> s; for(int i = 1; i <= n; i++) { s.insert(u[i]); } cout << s.size(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...