Submission #1037065

#TimeUsernameProblemLanguageResultExecution timeMemory
1037065juicyAdvertisement 2 (JOI23_ho_t2)C++17
100 / 100
120 ms14276 KiB
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.h" #else #define debug(...) 42 #endif int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<array<int, 2>> pt; for (int i = 1; i <= n; ++i) { int a, b; cin >> a >> b; pt.push_back({a + b, b - a}); } sort(pt.rbegin(), pt.rend()); int res = 0; int mx = -2e9; for (auto [x, y] : pt) { if (y > mx) { ++res; mx = y; } } cout << res; return 0; } // lmfao
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...