@@ -54,10 +54,10 @@ int orientation(pt a, pt b, pt c) {
5454bool cw(pt a, pt b, pt c) { return orientation(a, b, c) < 0; }
5555
5656void convex_hull(vector<pt >& a) {
57- pt p0 = * min_element(a.begin(), a.end(), [ & ] (pt a, pt b) {
57+ pt p0 = * min_element(a.begin(), a.end(), [ ] (pt a, pt b) {
5858 return make_pair(a.y, a.x) < make_pair(b.y, b.x);
5959 });
60- sort(a.begin(), a.end(), [ &] (pt a, pt b) {
60+ sort(a.begin(), a.end(), [ &p0 ] (const pt& a, const pt& b) {
6161 int o = orientation(p0, a, b);
6262 if (o == 0)
6363 return (p0.x-a.x)* (p0.x-a.x) + (p0.y-a.y)* (p0.y-a.y)
@@ -94,10 +94,10 @@ bool ccw(pt a, pt b, pt c) { return orientation(a, b, c) > 0; }
9494bool collinear(pt a, pt b, pt c) { return orientation(a, b, c) == 0; }
9595
9696void convex_hull(vector<pt >& a) {
97- pt p0 = * min_element(a.begin(), a.end(), [ & ] (pt a, pt b) {
97+ pt p0 = * min_element(a.begin(), a.end(), [ ] (pt a, pt b) {
9898 return make_pair(a.y, a.x) < make_pair(b.y, b.x);
9999 });
100- sort(a.begin(), a.end(), [ &] (pt a, pt b) {
100+ sort(a.begin(), a.end(), [ &p0 ] (const pt& a, const pt& b) {
101101 int o = orientation(p0, a, b);
102102 if (o == 0)
103103 return (p0.x-a.x)* (p0.x-a.x) + (p0.y-a.y)* (p0.y-a.y)
@@ -171,7 +171,7 @@ void convex_hull(vector<pt>& a) {
171171 if (a.size() == 1)
172172 return;
173173
174- sort(a.begin(), a.end(), [& ](pt a, pt b) {
174+ sort(a.begin(), a.end(), [](pt a, pt b) {
175175 return make_pair(a.x, a.y) < make_pair(b.x, b.y);
176176 });
177177 pt p1 = a[0], p2 = a.back();
0 commit comments