제출 #710869

#제출 시각아이디문제언어결과실행 시간메모리
710869awuLightning Rod (NOI18_lightningrod)C++14
100 / 100
1732 ms209964 KiB
#include <bits/extc++.h> using namespace std; #define f first #define s second #define all(x) x.begin(), x.end() using pii = pair<int, int>; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<pii> pts(n); for(int i = 0; i < n; i++) { int x, y; cin >> x >> y; pts[i] = {x, y}; } vector<pii> stac; for(auto p : pts) { #define sb stac.back() while(stac.size() && p.s - p.f >= sb.s - sb.f) { stac.pop_back(); } if(!stac.size() || p.f + p.s > sb.f + sb.s) { stac.push_back(p); } } cout << stac.size() << endl; }
#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...