Submission #768058

#TimeUsernameProblemLanguageResultExecution timeMemory
768058Trisanu_DasAdvertisement 2 (JOI23_ho_t2)C++17
100 / 100
349 ms13896 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; pair<int, int> a[n]; for(int i = 0; i < n; i++){ int x, y; cin >> x >> y; a[i] = make_pair(x - y, -x - y); } sort(a, a + n); int ans = 0, tmp = 0; for(int i = 0; i < n; i++){ if(tmp > a[i].second){ tmp = a[i].second; ans++; } } cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...