# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
865314 | Trisanu_Das | Lightning Rod (NOI18_lightningrod) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
set<pair<int, int> > s;
for(int i = 0; i < n; i++){
int x, y; cin >> x >> y;
s.insert({y, x});
}
int ans = 0;
while(!s.empty()){
pair<int, int> a = *s.rbegin();
vector<pair<int, int> > v;
for(auto i : s) if(abs(a.ss - i.ss) <= a.ff - i.ff) v.push_back(i);
for(auto i : v) s.erase(i);
}
cout << ans << '\n';
}