Submission #1106325

#TimeUsernameProblemLanguageResultExecution timeMemory
1106325LuvidiAdvertisement 2 (JOI23_ho_t2)C++17
100 / 100
122 ms14088 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #define fs first #define sc second #define pb push_back void solve() { int n; cin>>n; pii a[n]; for(int i=0;i<n;i++){ int x,e; cin>>x>>e; a[i]={-x-e,x-e}; } sort(a,a+n); int ans=0,m=2e9; for(int i=0;i<n;i++){ if(a[i].sc<m){ m=a[i].sc; ans++; } } cout<<ans<<'\n'; } int main() { #ifdef FPO freopen("in","r",stdin); freopen("out","w",stdout); #endif ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...