Submission #743098

#TimeUsernameProblemLanguageResultExecution timeMemory
743098vjudge1Lightning Rod (NOI18_lightningrod)C++17
40 / 100
2083 ms197972 KiB
#include<bits/stdc++.h> using namespace std; #define iii tuple<int,int,int> int n; struct top { int x,y,sta; }; vector<top> top; bool allone; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; for(int i=1;i<=n;++i) { int x,y; cin >> x >> y; if(y != 1) allone = false; top.push_back({x,y,1}); } if(allone) { cout << n; return 0; } for(int i=0;i<n;++i) { for(int j=0;j<n;++j) { if(i == j) continue; if(abs(top[i].x-top[j].x) <= top[i].y-top[j].y) { top[j].sta = 0; } } } int cnt = 0; for(int i=0;i<n;++i) { if(top[i].sta == 1) ++cnt; } cout << cnt; return 0; }
#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...