Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<PII> chull(vector<PII>& v) {
- int n = v.size();
- vector<PII> lower(n);
- int k = 0;
- for (int i = 0; i < n; ++i) {
- while (k>=2 and esc(lower[k-2],lower[k-1],v[i])<0) --k;
- lower[k++]=v[i];
- }
- lower.resize(k);
- return lower;
- }
Add Comment
Please, Sign In to add comment