Submission #1136128

#TimeUsernameProblemLanguageResultExecution timeMemory
1136128fzyzzz_zAdvertisement 2 (JOI23_ho_t2)C++20
10 / 100
99 ms4168 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<pair<int, int>> a(n); for (auto & [x, y]: a) { cin >> x >> y; auto x1 = x - y; auto y1 = x + y; x = x1; y = y1; } sort(a.begin(), a.end()); // find upper hull int ans = 0; int xx = -1, yy = -1; for (auto [x, y]: a) { if (xx == x && yy <= y) { xx = x; yy = y; } else if (y > yy) { xx = x; yy = y; ans++; } } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...