Submission #1063846

#TimeUsernameProblemLanguageResultExecution timeMemory
1063846LuvidiLightning Rod (NOI18_lightningrod)C++17
80 / 100
2008 ms246496 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++){ cin>>a[i].fs>>a[i].sc; a[i]={a[i].fs-a[i].sc,-a[i].fs-a[i].sc}; } sort(a,a+n); int cnt=0,last=2e9; for(int i=0;i<n;i++){ if(a[i].sc<last){ cnt++; last=a[i].sc; } } cout<<cnt; } int main() { 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...