criyle/codenet-compile-errors huggingface dataset:
Language: C++

200
679 341
456 251
-630 86
767 773
-510 265
727 381
989 -550
-387 768
-655 525
-280 844
540 755
926 -649
853 218
-993 -972
876 -235
896 585
-773 401
189 -940
801 -549
752 -125
-716 465
-393 312
624 -672
-554 -842
-331 144
-553 901
590 -498
-297 -802
-158 170
317 -342
208 -73
-359 854
-808 232
-286 603
463 -162
-768 264
-740 -952
392 -226
-486 106
-466 976
-919 -781
-987 728
-824 -974
186 -703
724 -899
252 -462
275 -609
774 416
-764 596
149 877
633 32
778 -705
-829 766
507 806
380 -512
273 -720
232 -196
-277 66
545 -680
320 100
582 947
417 -143
-491 255
26 596
-102 -697
71 806
-36 -61
150 182
170 -756
-878 544
-495 -634
-275 209
-347 979
-220 -936
795 -252
-432 267
-42 -140
920 8
-739 -612
-460 -196
551 743
-864 460
953 -787
-814 -935
801 -63
-850 988
64 -36
247 73
726 -795
-592 280
-30 -88
261 -460
224 -5
-223 -633
70 -647
683 47
266 30
844 -53
-371 -668
-879 -652
191 -54
-815 351
-775 -776
927 -959
-523 -868
-749 534
340 293
638 147
420 -515
-865 -406
-355 26
-13 363
-584 74
-505 453
179 794
-871 136
779 -583
-510 -359
-987 -466
620 672
-747 334
482 410
-307 610
476 -493
-51 586
-828 -924
377 -639
-121 -450
292 160
-719 -510
490 161
250 397
-853 26
636 -469
463 -831
-476 -248
63 441
876 823
-26 -636
710 -651
347 148
654 343
756 -337
-274 -940
-327 768
135 506
471 -660
-667 986
-644 -155
-867 -88
-759 493
-532 746
288 -860
-792 17
780 439
-120 414
-996 434
-991 458
138 869
-57 -462
769 -158
-130 -82
149 -207
623 -376
-29 713
-946 791
-204 818
103 518
-844 796
908 -200
8 927
41 -90
-86 382
447 -312
438 -220
642 -643
742 925
848 -361
-979 -39
555 -240
-248 218
-679 -949
-277 -989
739 13
731 -685
-488 793
-822 -806
328 -153
341 824
-845 965
754 403
754 -140
-544 -575
876 -104
-653 -524
430 -658
946 -80
780 41
-339 463
-799 324

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 200
      | ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  long n = 0;
  vector<pair<long, long> > vzPnt;
  {
    cin >> n;
    vzPnt.resize(n);
    long i = 0;
    for (i = 0; i < n; ++i) {
      cin >> vzPnt[i].first;
      cin >> vzPnt[i].second;
    }
    sort(vzPnt.begin(), vzPnt.end());

    if (true) {
      for (i = 0; i < n; ++1) {
        cout << vzPnt[i].first << " " << vzPnt[i].second << "\n";
      }
    }
  }



  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<pair<long, long> > vzPnt;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:27: error: expected primary-expression before '>' token
    6 |   vector<pair<long, long> > vzPnt;
      |                           ^
a.cc:6:29: error: 'vzPnt' was not declared in this scope
    6 |   vector<pair<long, long> > vzPnt;
      |                             ^~~~~
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(vzPnt.begin(), vzPnt.end());
      |     ^~~~
      |     short
a.cc:18:28: error: lvalue required as increment operand
   18 |       for (i = 0; i < n; ++1) {
      |                            ^
Language: C++

#include <iostream>
#include <vector>
#include <map>
using namespace std;

int main() {
  long n = 0;
  vector<pair<long, long> > vzPnt;
  {
    cin >> n;
    vzPnt.resize(n);
    long i = 0;
    for (i = 0; i < n; ++i) {
      cin >> vzPnt[i].first;
      cin >> vzPnt[i].second;
    }
    sort(vzPnt.begin(), vzPnt.end());

    if (true) {
      for (i = 0; i < n; ++1) {
        cout << vzPnt[i].first << " " << vzPnt[i].second << "\n";
      }
    }
  }



  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |     sort(vzPnt.begin(), vzPnt.end());
      |     ^~~~
      |     short
a.cc:20:28: error: lvalue required as increment operand
   20 |       for (i = 0; i < n; ++1) {
      |                            ^
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

int main() {
  long n = 0;
  vector<pair<long, long> > vzPnt;
  {
    cin >> n;
    vzPnt.resize(n);
    long i = 0;
    for (i = 0; i < n; ++i) {
      cin >> vzPnt[i].first;
      cin >> vzPnt[i].second;
    }
    sort(vzPnt.begin(), vzPnt.end());

    if (true) {
      for (i = 0; i < n; ++1) {
        cout << vzPnt[i].first << " " << vzPnt[i].second << "\n";
      }
    }
  }



  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: lvalue required as increment operand
   22 |       for (i = 0; i < n; ++1) {
      |                            ^
Language: C++

#include<algorithm>
#include<stdio.h>
#include<utility>
#include<vector>
int gcd(int a, int b) {
  return b ? gcd(b, a%b) : a;
}
void Input(std::vector<std::pair<int ,int> > &vnnInput);
bool bCrossProduct (std::pair<int,int > &point, std::vector<std::pair<int,int> >& StackPoints,int i);
int main(void){
    int nInput;
    scanf("%d",&nInput );
    std::vector<std::pair<int ,int> > vnnInput(nInput);
    Input( vnnInput);
    //vnniValuePoint((angle,lenght_2),n)
    std::vector<std::pair<std::pair<double ,double>,size_t> > vnniValuePoint(nInput);
    vnniValuePoint[0]=std::pair<std::pair<double ,double>,size_t>(std::pair<double ,double>(0.,0.),0);
     for(int i=1;i<nInput;++i ){
        int dX=     vnnInput[i].first-vnnInput[0].first;
        int dY=     vnnInput[i].second-vnnInput[0].second;        
        int nLength_2=dX*dX+dY*dY;
        vnniValuePoint[i].first.second=1.*nLength_2;        
        int GCD=gcd(dX,dY);
        dX/=GCD;
        nLength_2/=(GCD*GCD);
        vnniValuePoint[i].first.first=std::acos(dX/std::sqrt(1.*nLength_2));
         vnniValuePoint[i].second=i;
    }
     std::sort(vnniValuePoint.begin(),vnniValuePoint.end());

     std::vector<std::pair<int ,int> > vnnSortedput(nInput);
     for(int i=0;i<nInput;++i){
         vnnSortedput[i]= vnnInput[vnniValuePoint[i].second];
     }

    int iIndex=0;
    for (int i = 1; i <nInput-1 ; ++i){
       vnnInput[++iIndex] = vnnSortedput[i];

         while (!bCrossProduct (vnnSortedput[i+1],vnnInput,iIndex)){
             --iIndex  ;
        }
       
    }
    vnnInput[++iIndex] = vnnSortedput[nInput-1];
    
     
    printf("%d\n",++iIndex);//++??¢???????????????=????´???°

    
    for (int i = 0 ;i < iIndex; ++i){
        printf("%d %d\n",vnnInput[i].first,vnnInput[i].second);
    }
    //system("pause");
    return 0;
}

void Input(std::vector<std::pair<int ,int> > &vnnInput){
    for(int i=0;i<vnnInput.size();++i){
    scanf("%d%d",&vnnInput[i].second,&vnnInput[i].first);
    }
    std::sort(vnnInput.begin(),vnnInput.end());
    for(int i=0;i<vnnInput.size();++i){
    std::swap(vnnInput[i].first,vnnInput[i].second);
    }
}

bool bCrossProduct (std::pair<int,int > &point, std::vector<std::pair<int,int> >& StackPoints,int i){
       
  
    double dValueCrossPro;
   
        dValueCrossPro = 
            (StackPoints[i].first - StackPoints[i-1].first) 
                * (point.second - StackPoints[i].second)
            -(StackPoints[i].second - StackPoints[i-1].second) 
                * (point.first - StackPoints[i].first) ;
        return dValueCrossPro >= 0;
     
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:44: error: 'acos' is not a member of 'std'
   26 |         vnniValuePoint[i].first.first=std::acos(dX/std::sqrt(1.*nLength_2));
      |                                            ^~~~
a.cc:26:57: error: 'sqrt' is not a member of 'std'; did you mean 'sort'?
   26 |         vnniValuePoint[i].first.first=std::acos(dX/std::sqrt(1.*nLength_2));
      |                                                         ^~~~
      |                                                         sort
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

class Point {
public:
    int x, y;
    Point(int a, int b) { 
        x = a;
        y = b; 
    }
#if 0
    Point() : x(0), y(0) 
    {
    }
#endif
    bool operator <(const Point &p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

vector<Point> convex_hull(vector<Point> P, int n)
{
    int k = 1;
    vector<Point> H;
    H.push_back(P[0]);
    H.push_back(P[1]);
    for (int i = 0; i < n - 2; i++) {
        if ((H[k].x - H[k - 1].x) * (P[i + 2].y - H[k - 1].y) - (H[k].y - H[k - 1].y) * (P[i + 2].x - H[k - 1].x) < 0) {
            H.pop_back();
            k--;
            while (k >= 1 && (H[k].x - H[k - 1].x) * (P[i + 2].y - H[k - 1].y) - (H[k].y - H[k - 1].y) * (P[i + 2].x - H[k - 1].x) < 0) {
                H.pop_back();
                k--;
            }
            H.push_back(P[i + 2]);
            k++;
        }
        else {
            H.push_back(P[i + 2]);
            k++;
        }
    }
    H.push_back(P[n - 2]);
    for (int i = n; i > 2; i--) {
        if ((H[k + 1].x - H[k].x) * (P[i - 3].y - H[k].y) - (H[k + 1].y - H[k].y) * (P[i - 3].x - H[k].x) < 0) {
            H.pop_back();
            k--;
            while ((H[k + 1].x - H[k].x) * (P[i - 3].y - H[k].y) - (H[k + 1].y - H[k].y) * (P[i - 3].x - H[k].x) < 0) {
                H.pop_back();
                k--;
            }
            H.push_back(P[i - 3]);
            k++;
        }
        else {
            H.push_back(P[i - 3]);
            k++;
        }
    }
    H.pop_back();
#if 0
    if ((H[k].x - H[k - 1].x) * (H[0].y - H[k - 1].y) - (H[k].y - H[k - 1].y) * (H[0].x - H[k - 1].x) < 0) {
        H.pop_back();
    }
#endif
    return H;
}

int main() {
    int n;
    cin >> n;
    vector<Point> P;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        Point point(a, b);
        P.push_back(point);
        int j = i + 1;
        while (j >= 2 && point < P[j - 2]) {
            P[j - 1] = P[j - 2];
            j--;
        }
        P[j - 1] = point;
    }
    //vector<Point>& H;
    vector<Point>& H = convex_hull(P, n);
    cout << H.size() << endl;
    for (int i = 0; i < H.size(); i++) {
        cout << H[i].x << " " <<  H[i].y << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:89:35: error: cannot bind non-const lvalue reference of type 'std::vector<Point>&' to an rvalue of type 'std::vector<Point>'
   89 |     vector<Point>& H = convex_hull(P, n);
      |                        ~~~~~~~~~~~^~~~~~
Language: C++

#include <stdio.h>
#include <vector>

using namespace std;

class Point {
public:
    int x, y;
    Point(int a, int b) { 
        x = a;
        y = b; 
    }
    bool operator <(const Point &p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

vector<Point> convex_hull(vector<Point>& P)
{
    int k = 1;
    int n = P.size();
    vector<Point> H;
    H.push_back(P[0]);
    H.push_back(P[1]);
    int i;
    for (i = 0; i < n - 2; i++) {
        while (k >= 1 && (H[k].x - H[k - 1].x) * (P[i + 2].y - H[k - 1].y) - (H[k].y - H[k - 1].y) * (P[i + 2].x - H[k - 1].x) < 0) {
            H.pop_back();
            k--;
        }
        H.push_back(P[i + 2]);
        k++;
    }
    H.push_back(P[n - 2]);
    for (i = n; i > 2; i--) {
        while ((H[k + 1].x - H[k].x) * (P[i - 3].y - H[k].y) - (H[k + 1].y - H[k].y) * (P[i - 3].x - H[k].x) < 0) {
            H.pop_back();
            k--;
        }
        H.push_back(P[i - 3]);
        k++;
    }
    H.pop_back();
    return H;
}

int main() {
    int n;
    scanf_s("%d", &n);
    vector<Point> P;
    int i;
    for (i = 0; i < n; i++) {
        int a, b;
        scanf_s("%d %d",&a, &b);
        Point point(a, b);
        P.push_back(point);
        int j = i + 1;
        while (j >= 2 && point < P[j - 2]) {
            P[j - 1] = P[j - 2];
            j--;
        }
        P[j - 1] = point;
    }
    vector<Point> H;
    H = convex_hull(P);
    printf("%d\n", H.size());
    for (i = 0; i < (int)H.size(); i++) {
        printf("%d %d\n", &H[i].x, &H[i].y);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   49 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <stdio.h>
#include <vector>

using namespace std;

class Point {
public:
    int x, y;
    Point(int a, int b) { 
        x = a;
        y = b; 
    }
    bool operator <(const Point &p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

vector<Point> convex_hull(vector<Point>& P)
{
    int k = 1;
    int n = P.size();
    vector<Point> H;
    H.push_back(P[0]);
    H.push_back(P[1]);
    int i;
    for (i = 0; i < n - 2; i++) {
        while (k >= 1 && (H[k].x - H[k - 1].x) * (P[i + 2].y - H[k - 1].y) - (H[k].y - H[k - 1].y) * (P[i + 2].x - H[k - 1].x) < 0) {
            H.pop_back();
            k--;
        }
        H.push_back(P[i + 2]);
        k++;
    }
    H.push_back(P[n - 2]);
    for (i = n; i > 2; i--) {
        while ((H[k + 1].x - H[k].x) * (P[i - 3].y - H[k].y) - (H[k + 1].y - H[k].y) * (P[i - 3].x - H[k].x) < 0) {
            H.pop_back();
            k--;
        }
        H.push_back(P[i - 3]);
        k++;
    }
    H.pop_back();
    return H;
}

int main() {
    int n;
    scanf_s("%d", &n);
    vector<Point> P;
    int i;
    for (i = 0; i < n; i++) {
        int a, b;
        scanf_s("%d %d",&a, &b);
        Point point(a, b);
        P.push_back(point);
        int j = i + 1;
        while (j >= 2 && point < P[j - 2]) {
            P[j - 1] = P[j - 2];
            j--;
        }
        P[j - 1] = point;
    }
    vector<Point> H;
    H = convex_hull(P);
    printf("%d\n", H.size());
    for (i = 0; i < (int)H.size(); i++) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   49 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <stdio.h>
#include <vector>

class Point {
public:
    int x, y;
    Point(int a, int b);
    Point();
    bool operator <(const Point &p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

Point::Point(int a, int b) : x(a), y(b)
{
}

Point::Point()
{
    int x = 0;
    int y = 0;
}

void convex_hull(const std::vector<Point>& P)
{
    int k = 2;
    int n = P.size();
    std::vector<Point> H;
    H.resize(2 * n);
    H[0] = P[0];
    //H.push_back(P[0]);
    H[1] = P[1];
    //H.push_back(P[1]);
    int i;
    for (i = 0; i < n - 2; i++) {
        while (k >= 2 && (H[k - 1].x - H[k - 2].x) * (P[i + 2].y - H[k - 2].y) - (H[k - 1].y - H[k - 2].y) * (P[i + 2].x - H[k - 2].x) < 0) {
            k--;
            //H.pop_back();
            //k--;
        }
        H[k++] = P[i + 2];
        //H.push_back(P[i + 2]);
        //k++;
    }
    H[k++] = P[n - 2];
    // H.push_back(P[n - 2]);
    for (i = n; i > 2; i--) {
        while ((H[k - 1].x - H[k - 2].x) * (P[i - 3].y - H[k - 2].y) - (H[k - 1].y - H[k - 2].y) * (P[i - 3].x - H[k - 2].x) < 0) {
            //H.pop_back();
            k--;
        }
        //H.push_back(P[i - 3]);
        H[k++] = P[i - 3];
        //k++;
    }
    H.resize(k);
    printf("%d\n", H.size());
    for (i = 0; i < (int)H.size(); i++) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
}

int main() {
    int n;
    scanf_s("%d", &n);
    std::vector<Point> P(n);
    int i;
    for (i = 0; i < n; i++) {
        Point point;
        scanf_s("%d %d",&point.x, &point.y);
        P[i] = point;
        int j = i + 1;
        while (j >= 2 && point < P[j - 2]) {
            P[j - 1] = P[j - 2];
            j--;
        }
        P[j - 1] = point;
    }
    convex_hull(P);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   65 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <stdio.h>
#include <vector>

class Point {
public:
    int x, y;
    Point(int a, int b);
    Point();
    bool operator <(const Point &p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

Point::Point(int a, int b) : x(a), y(b)
{
}
#if 0
Point::Point()
{
    int x = 0;
    int y = 0;
}
#endif
void convex_hull(const std::vector<Point>& P)
{
    int k = 2;
    int n = P.size();
    std::vector<Point> H;
    H.resize(2 * n);
    H[0] = P[0];
    //H.push_back(P[0]);
    H[1] = P[1];
    //H.push_back(P[1]);
    int i;
    for (i = 0; i < n - 2; i++) {
        while (k >= 2 && (H[k - 1].x - H[k - 2].x) * (P[i + 2].y - H[k - 2].y) - (H[k - 1].y - H[k - 2].y) * (P[i + 2].x - H[k - 2].x) < 0) {
            k--;
            //H.pop_back();
            //k--;
        }
        H[k++] = P[i + 2];
        //H.push_back(P[i + 2]);
        //k++;
    }
    H[k++] = P[n - 2];
    // H.push_back(P[n - 2]);
    for (i = n; i > 2; i--) {
        while (k >= 2 && (H[k - 1].x - H[k - 2].x) * (P[i - 3].y - H[k - 2].y) - (H[k - 1].y - H[k - 2].y) * (P[i - 3].x - H[k - 2].x) < 0) {
            //H.pop_back();
            k--;
        }
        //H.push_back(P[i - 3]);
        H[k++] = P[i - 3];
        //k++;
    }
    H.resize(k - 1);
    printf("%d\n", H.size());
    for (i = 0; i < (int)H.size(); i++) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
}

int main() {
    int n;
    scanf("%d", &n);
    std::vector<Point> P(n);
    int i;
    for (i = 0; i < n; i++) {
        Point point;
        scanf("%d %d",&point.x, &point.y);
        P[i] = point;
        int j = i + 1;
        while (j >= 2 && point < P[j - 2]) {
            P[j - 1] = P[j - 2];
            j--;
        }
        P[j - 1] = point;
    }
    convex_hull(P);
    return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccU9d59N.o: in function `main':
a.cc:(.text+0x522): undefined reference to `Point::Point()'
/usr/bin/ld: /tmp/ccU9d59N.o: in function `void std::_Construct<Point>(Point*)':
a.cc:(.text._ZSt10_ConstructI5PointJEEvPT_DpOT0_[_ZSt10_ConstructI5PointJEEvPT_DpOT0_]+0x31): undefined reference to `Point::Point()'
collect2: error: ld returned 1 exit status
Language: C++

#include <stdio.h>
#include <vector>
using namespace std;

class Point {
public:
    int x, y;
    Point(int a, int b) : x(a), y(b)
    {
    };
    Point()
    {
        int x = 0;
        int y = 0;
    }
    bool operator <(const Point &p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

bool direct(Point& base, Point& a, Point& b) {
    return (a.x - base.x)*(b.y - base.y) - (a.y - base.y)*(b.x - base.x) < 0;
}

int main() {
    int n;
    scanf("%d", &n);
    vector<Point> P(n);
    int i;
    for (i = 1; i <= n; ++i) {
        Point point;
        scanf("%d %d",&point.x, &point.y);
        P[i - 1] = point;
        register int j = i;
        while (j >= 2 && point < P[j - 2]) {
            P[j - 1] = P[j - 2];
            j--;
        }
        P[j - 1] = point;
    }
    int k = 2;
    vector<Point> H(2 * n);
    H[0] = P[0];
    H[1] = P[1];
    int i;
    for (i = 0; i < n - 2; ++i) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i + 2])) k--;
        H[k++] = P[i + 2];
    }
    H[k++] = P[n - 2];
    for (i = n; i > 2; i--) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i - 3])) k--;
        H[k++] = P[i - 3];
    }
    H.resize(k - 1);
    printf("%d\n", k - 1);
    for (i = 0; i < k - 1; ++i) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   34 |         register int j = i;
      |                      ^
a.cc:45:9: error: redeclaration of 'int i'
   45 |     int i;
      |         ^
a.cc:29:9: note: 'int i' previously declared here
   29 |     int i;
      |         ^
Language: C++

#include <cstdio>
#include <vector>
using namespace std;

class Point {
public:
    int x, y;
    Point(int a = 0, int b = 0)
    {
        int x = a;
        int y = b;
    };
    bool operator <(const Point& p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

inline bool direct(Point& base, Point& a, Point& b) {
    return (a.x - base.x)*(b.y - base.y) - (a.y - base.y)*(b.x - base.x) < 0;
}

int main() {
    int n, i;
    int k = 2;
    vector<Point> P(100000), H(150000);
    scanf_s("%d", &n);
    for (i = 1; i <= n; ++i) {
        scanf_s("%d%d",&P[i - 1].x, &P[i - 1].y);
        Point point = P[i - 1];
        register int j = i;
        while (j >= 2 && point < P[j - 2]) {
            P[j - 1] = P[j - 2];
            j--;
        }
        P[j - 1] = point;
    }
    H[0] = P[0];
    H[1] = P[1];
    for (i = 0; i < n - 2; ++i) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i + 2])) k--;
        H[k++] = P[i + 2];
    }
    H[k++] = P[n - 2];
    for (i = n; i > 2; i--) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i - 3])) k--;
        H[k++] = P[i - 3];
    }
    printf("%d\n", k - 1);
    for (i = 0; i < k - 1; ++i) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   26 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
a.cc:30:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   30 |         register int j = i;
      |                      ^
Language: C++

#include <cstdio>
#include <vector>
using namespace std;

class Point {
public:
    int x, y;
    Point(int a = 0, int b = 0)
    {
        int x = a;
        int y = b;
    };
    bool operator <(const Point& p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

inline bool direct(Point& base, Point& a, Point& b) {
    return (a.x - base.x)*(b.y - base.y) - (a.y - base.y)*(b.x - base.x) < 0;
}

int main() {
    int n, i, j;
    int k = 2;
    vector<Point> P(100000), H(200000);
    scanf_s("%d", &n);
    for (i = 1, j = i; i <= n; ++i) {
        scanf_s("%d%d",&P[i - 1].x, &P[i - 1].y);
        Point point = P[i - 1];
        while (j >= 2 && point < P[j - 2]) {
            P[j - 1] = P[j - 2];
            j--;
        }
        P[j - 1] = point;
    }
    H[0] = P[0];
    H[1] = P[1];
    for (i = 0; i < n - 2; ++i) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i + 2])) k--;
        H[k++] = P[i + 2];
    }
    H[k++] = P[n - 2];
    for (i = n; i > 2; i--) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i - 3])) k--;
        H[k++] = P[i - 3];
    }
    printf("%d\n", k - 1);
    for (i = 0; i < k - 1; ++i) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   26 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

class Point {
public:
    int x, y;
    Point(int a = 0, int b = 0)
    {
        int x = a;
        int y = b;
    };
    bool operator <(const Point& p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

inline bool direct(Point& base, Point& a, Point& b) {
    return (a.x - base.x)*(b.y - base.y) - (a.y - base.y)*(b.x - base.x) < 0;
}

void swap(Point* a, Point* b) {
    Point t;
    t = *a;
    *a = *b;
    *b = t;
}

int main() {
    int n, i;
    int k = 2;
    vector<Point> P(100000), H(200000);
    scanf_s("%d", &n);
    for (i = 0; i < n; ++i) {
        scanf_s("%d%d",&P[i].x, &P[i].y);
    }
    sort(P.begin(), P.end());
    H[0] = P[0];
    H[1] = P[1];
    for (i = 0; i < n - 2; ++i) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i + 2])) k--;
        H[k++] = P[i + 2];
    }
    H[k++] = P[n - 2];
    for (i = n; i > 2; i--) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i - 3])) k--;
        H[k++] = P[i - 3];
    }
    printf("%d\n", k - 1);
    for (i = 0; i < k - 1; ++i) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   34 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <cstdio>
#include <vector>
using namespace std;

class Point {
public:
    int x, y;
    Point(int a = 0, int b = 0)
    {
        int x = a;
        int y = b;
    };
    bool operator <(const Point& p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
    bool direct(Point& base, Point& a, Point& b) {
        return (a.x - base.x)*(b.y - base.y) - (a.y - base.y)*(b.x - base.x) < 0;
    }
};

int main() {
    int n, i;
    int k = 2;
    vector<Point> P(100000), H(200000);
    scanf("%d", &n);

    for (i = 1; i <= n; ++i) {
        scanf("%d%d",&P[i - 1].x, &P[i - 1].y);
        Point point = P[i - 1];
        register int j = i;
        while (j >= 2 && point < P[j - 2]) {
            P[j - 1] = P[j - 2];
            j--;
        }
        P[j - 1] = point;
    }

    H[0] = P[0];
    H[1] = P[1];
    for (i = 0; i < n - 2; ++i) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i + 2])) k--;
        H[k++] = P[i + 2];
    }
    H[k++] = P[n - 2];
    for (i = n; i > 2; i--) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i - 3])) k--;
        H[k++] = P[i - 3];
    }
    printf("%d\n", k - 1);
    for (i = 0; i < k - 1; ++i) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   30 |         register int j = i;
      |                      ^
a.cc:41:26: error: 'direct' was not declared in this scope
   41 |         while (k >= 2 && direct(H[k - 2],H[k - 1],P[i + 2])) k--;
      |                          ^~~~~~
a.cc:46:26: error: 'direct' was not declared in this scope
   46 |         while (k >= 2 && direct(H[k - 2],H[k - 1],P[i - 3])) k--;
      |                          ^~~~~~
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

class Point {
public:
    int x, y;
    Point(int a = 0, int b = 0)
    {
        int x = a;
        int y = b;
    };
    bool operator <(const Point& p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

inline bool direct(Point& base, Point& a, Point& b) {
    return (a.x - base.x)*(b.y - base.y) - (a.y - base.y)*(b.x - base.x) < 0;
}


int main() {
    int n, i;
    int k = 2;
    Point* P;
    Point* H;
    scanf_s("%d", &n);
    P = new Point[n];
    for (i = 1; i <= n; ++i) {
        scanf_s("%d%d",&P[i - 1].x, &P[i - 1].y);
        Point point = P[i - 1];
        int j;
        for (j = i; j >= 2 && point < P[j - 2]; j--) {
            P[j - 1] = P[j - 2];
        }
        P[j - 1] = point;
    }
    H = new Point[2*n];
    H[0] = P[0];
    H[1] = P[1];
    for (i = 0; i < n - 2; ++i) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i + 2])) k--;
        H[k++] = P[i + 2];
    }
    H[k++] = P[n - 2];
    for (i = n; i > 2; i--) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i - 3])) k--;
        H[k++] = P[i - 3];
    }
    printf("%d\n", k - 1);
    for (i = 0; i < k - 1; ++i) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   29 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

class Point {
public:
    int x, y;
    Point(int a = 0, int b = 0)
    {
        int x = a;
        int y = b;
    };
    bool operator <(const Point& p) const {
        return y < p.y || (y == p.y && x < p.x);
    }
};

inline bool direct(Point& base, Point& a, Point& b) {
    return (a.x - base.x)*(b.y - base.y) - (a.y - base.y)*(b.x - base.x) < 0;
}


int main() {
    int n, i;
    int k = 2;
    Point* P;
    Point* H;
    scanf_s("%d", &n);
    P = new Point[n];
    for (i = 1; i <= n; ++i) {
        scanf_s("%d%d",&P[i - 1].x, &P[i - 1].y);
#if 0
        Point point = P[i - 1];
        int j;
        for (j = i; j >= 2 && point < P[j - 2]; j--) {
            P[j - 1] = P[j - 2];
        }
        P[j - 1] = point;
#endif
    }
    sort(P, P + n);
    H = new Point[2*n];
    H[0] = P[0];
    H[1] = P[1];
    for (i = 0; i < n - 2; ++i) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i + 2])) k--;
        H[k++] = P[i + 2];
    }
    H[k++] = P[n - 2];
    for (i = n; i > 2; i--) {
        while (k >= 2 && direct(H[k - 2],H[k - 1],P[i - 3])) k--;
        H[k++] = P[i - 3];
    }
    printf("%d\n", k - 1);
    for (i = 0; i < k - 1; ++i) {
        printf("%d %d\n", H[i].x, H[i].y);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   29 |     scanf_s("%d", &n);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <iostream>
#include <vector>
#include <complex>
#include <utility>
#define X real()
#define Y imag()
#define EPS 1e-10
using namespace std;
typedef complex<double> P;
typedef vector<P> Poly;
typedef pair<P,P> L;

namespace std{
  bool operator<(const P& a, const P& b){
    return a.X != b.X ? a.X < b.X : a.Y < b.Y;
  }

  bool cmp_y(const P &a, const P &b){
    return a.Y != b.Y ? a.Y < b.Y : a.X < b.X;
  }
}

double cross(P a, P b){
  return a.X*b.Y - a.Y*b.X;
}

Poly convex_hull(Poly v){
  int n = v.size(), k = 0;
  sort(v.begin(), v.end());
  Poly r(2*n);
  for(int i = 0; i < n; i++){
    while(k>1 && cross(r[k-1]-r[k-2],v[i]-r[k-2]) < -EPS)k--;
    r[k++] = v[i];
  }
  for(int i = n-2, t = k; i >= 0; i--){
    while(k>t && cross(r[k-1]-r[k-2],v[i]-r[k-2]) < -EPS)k--;
    r[k++] = v[i];
  }
  r.resize(k-1);
  return r;
}

int main(){
  int n;
  cin >> n;
  double x, y;
  Poly p;
  for(int i = 0; i < n; ++i){
    cin >> x >> y;
    p.push_back(P(x,y));
  }
  Poly ans = convex_hull(p);
  cout << ans.size() << endl;
  for(int i = 0; i < ans.size(); ++i){
    printf("%d %d\n", (int)ans[i].X, (int)ans[i].Y);
  }
  return 0;
}

Compiler output:
a.cc: In function 'Poly convex_hull(Poly)':
a.cc:29:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   29 |   sort(v.begin(), v.end());
      |   ^~~~
      |   sqrt
Language: C++

#include <iostream>
#include <complex>
#include <vector>
#include <algorithm>
using namespace std;

bool cp(const complex<double>& a, const complex<double>& b){
  return (a.real()<b.real())||(a.real()==b.real() && a.imag()<b.imag());
}

int main(){
  int n;
  cin >> n;
  vector<complex<double> > v;

  for(int i=0;i<n;i++){
    int x,y;
    cin >> x >> y;
    v.push_back(complex<double>(x,y));
  }

  sort(v.begin(),v.end(),cp);

  vector<complex<double> > u,b;
  int i;
  for(i=0;v[i].real()==v[0].real();i++) ;
  u.push_back(v[0]);
  b.push_back(v[0]);


  int j=1;
  while(u.back().real()!=v.back().real()){
    u.push_back(v[j]);	//??\????????????
    int l=u.size();

//l=2 ??? (l>3and(u[l-2]-u[l-3]???u[l-1]-u[l-2]???????§???\???))??????OK
//???????????°?¬????????????????????????????????????????????????????????????´???

    if(l==2) j++;
    else if(arg(u[l-2]-u[l-3])>=arg(u[l-1]-u[l-2])) j++;
    else{
      u.pop_back();
      u.pop_back();
    }
  }
  u.pop_back();
  u.push_back(v[n-1]);

  j=i;
  while(b.back()!=v.back()){
    b.push_back(v[j]);	//??\????????????
cout << j << ": " << v[j].real() << "," << v[j].imag() << endl;
    int l=b.size();

//l=2 ??? (l>3and(b[l-2]-b[l-3]???b[l-1]-b[l-2]???????§???\???))??????OK
//???????????°?¬????????????????????????????????????????????????????????????´???

    if(l==2) j++;
    else if(arg(b[l-2]-b[l-3])=<arg(b[l-1]-b[l-2])) j++;
    else{
      b.pop_back();
      b.pop_back();
    }
  }

  if(u.back()==b.back()) b.pop_back();

  vector<complex<double> > ru;
  for(int k=0;k<u.size();k++)
    ru.push_back(u[u.size()-1-k]);

  if(ru.back()==b.front()) ru.pop_back();

  b.insert(b.end(),ru.begin(),ru.end());

  for(i=b.size();i<b.size()*2;i++)
    if(b[(i-1)%b.size()].imag()>b[i%b.size()].imag() && b[i%b.size()].imag()<=b[(i+1)%b.size()].imag())
      break;

  cout << b.size() << endl;
  for(int k=0;k<b.size();k++)
    cout << b[(i+k)%b.size()].real() << ' ' << b[(i+k)%b.size()].imag() << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:32: error: expected primary-expression before '<' token
   59 |     else if(arg(b[l-2]-b[l-3])=<arg(b[l-1]-b[l-2])) j++;
      |                                ^
Language: C++

def isCLKWISE(ph):
    a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
    b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
    crs = a[0]*b[1] - a[1]*b[0]
    if crs < 0 :
        return False
    else :
        return True
     
def ConvexHullScan(P):
    P = sorted(P)
    phU = [P[0],P[1]]
    for p in P[2:]:
        phU.append(p)
        while(True):
            if isCLKWISE(phU) :
                break
            else :
                del phU[-2]
                if len(phU) == 2 :
                    break
    phL = [P[-1],P[-2]]
    for p in P[-3::-1]:
        phL.append(p)
        while(True):
            if isCLKWISE(phL) :
                break
            else :
                del phL[-2]
                if len(phL) == 2 :
                    break
    ph = phU + phL[1:-1]
    return ph
 
n = int(input())
P = []
for i in range(n):
    P.append([int(x) for x in input().split()])
     
Q = ConvexHullScan(P)
Q.reverse()
print(len(Q))
idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(Q)])[2]
R = Q[idx:] + Q[:idx]
for r in R:
    print(r[0],r[1])

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def isCLKWISE(ph):
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define CLOCKWISE 1
struct point{
	int x,y;
	point operator - (const point p){
		point pp;
		pp.x=x-p.x;
		pp.y=y-p.y;
		return pp;
	}
	operator < (const point& p)const{
		if(x==p.x)return y<p.y;
		return x<p.x;
	}
}pp[100005];
vector<point> stk1;
vector<point> stk2;
int n;
double waiji(point p1,point p2){
	return p1.x*p2.y-p1.y*p2.x;
}
double neiji(point p1,point p2){
	return p1.x*p2.x+p1.y*p2.y;
}
bool ccw(point pa,point pb,point pc){
	if(waiji(pb-pa,pc-pa)<=0)return CLOCKWISE;
}
void andrew(){
	sort(pp,pp+n);
	stk1.clear();
	stk2.clear();
//	if(n<3)return;
	stk1.push_back(pp[0]); 
	stk1.push_back(pp[1]); 
	stk2.push_back(pp[n-1]); 
	stk2.push_back(pp[n-2]); 
	for(int i=2;i<n;i++){
		for(int j=stk1.size();j>=2&&ccw(stk1[j-2],stk1[j-1],pp[i])!=CLOCKWISE;j--)
			stk1.pop_back();
		stk1.push_back(pp[i]);
	}
	for(int i=n-3;i>=0;i--){
		for(int j=stk2.size();j>=2&&ccw(stk2[j-2],stk2[j-1],pp[i])!=CLOCKWISE;j--)
			stk2.pop_back();
		stk2.push_back(pp[i]);
	}
	reverse(stk2.begin(),stk2.end());
	for(int i=stk1.size()-2;i>=1;i--)stk2.push_back(stk1[i]);
}
int main(){
	scanf("%d",&n);
	for(int i=0;i<n;i++)cin>>pp[i].x>>pp[i].y;
	andrew();
	cout<<stk2.size()<<endl;
	for(int i=0;i<stk2.size();i++){
		cout<<stk2[i].x<<' '<<stk2[i].y<<endl;
	}
	return 0;
}



Compiler output:
a.cc:12:9: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
   12 |         operator < (const point& p)const{
      |         ^~~~~~~~
a.cc: In function 'bool ccw(point, point, point)':
a.cc:28:1: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define CLOCKWISE 1
struct point{
	int x,y;
	point operator - (const point p){
		point pp;
		pp.x=x-p.x;
		pp.y=y-p.y;
		return pp;
	}
	bool operator < (const point& p)const{
		if(x==p.x)return y<p.y;
		return x<p.x;
	}
}pp[100005];
vector<point> stk1;
vector<point> stk2;
int n;
double waiji(point p1,point p2){
	return p1.x*p2.y-p1.y*p2.x;
}
double neiji(point p1,point p2){
	return p1.x*p2.x+p1.y*p2.y;
}
double eps=1e-9;
bool ccw(point pa,point pb,point pc){
	if(waiji(pb-pa,pc-pa)<=eps)return CLOCKWISE;
}
void andrew(){
	sort(pp,pp+n);
	stk1.clear();
	stk2.clear();
//	if(n<3)return;
	stk1.push_back(pp[0]); 
	stk1.push_back(pp[1]); 
	stk2.push_back(pp[n-1]); 
	stk2.push_back(pp[n-2]); 
	for(int i=2;i<n;i++){
		for(int j=stk1.size();j>=2&&ccw(stk1[j-2],stk1[j-1],pp[i])!=CLOCKWISE;j--)
			stk1.pop_back();
		stk1.push_back(pp[i]);
	}
	for(int i=n-3;i>=0;i--){
		for(int j=stk2.size();j>=2&&ccw(stk2[j-2],stk2[j-1],pp[i])!=CLOCKWISE;j--)
			stk2.pop_back();
		stk2.push_back(pp[i]);
	}
	reverse(stk2.begin(),stk2.end());
	for(int i=stk1.size()-2;i>=1;i--)stk2.push_back(stk1[i]);
}
int main(){
//	freopen("a.txt","r",stdin);
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%d%d",&pp[i].x,&pp[i].y);
	andrew();
	printf("%d\n",stk2.size());
	for(int i=0;i<stk2.size()-1;i++){
		printf("%d %d\n",stk2[i].x,stk2[i].y);
	}
	printf("%d %d",stk2[i].x,stk2[i].y);
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:61:29: error: 'i' was not declared in this scope
   61 |         printf("%d %d",stk2[i].x,stk2[i].y);
      |                             ^
a.cc: In function 'bool ccw(point, point, point)':
a.cc:29:1: warning: control reaches end of non-void function [-Wreturn-type]
   29 | }
      | ^
Language: C

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#define max(a,b) a<b?b:a
#define min(a,b) a<b?a:b
#define POW2(a)  a*a
#define ROOP(i,n) for(i = 0;i < n;i++)
#define _USE_MATH_DEFINES

typedef struct POINT{
	double x;
	double y;
}POINT;

//????????????????????¢
double norm(POINT a){
	return sqrt(norm2(a));
}

//a->b?????´??§???????????????
POINT make_vec(POINT a,POINT b){
	b.x -= a.x;

	b.y -= a.y;
	return b;
}

double distance(POINT a,POINT b){
	return norm(make_vec(a,b));
}


double diameter_poly(POINT p[],int n){
	POINT g[n];
	int i,j,m = -1;
	for(i = 0;i < n;i++){
		for(j = i+1;j < n;j++){
			m = max(distance(p[i],p[j]),m);
		}
	}
	return m;
}

int main(){
	int k;
	int i;
	POINT p[101];
	scanf("%d",&k);
	for(i =0 ;i < k;i++){
		scanf("%lf%lf",&p[i].x,&p[i].y);
	}
	printf("%.10lf\n",diameter_poly(p,k));
	return 0;
}

Compiler output:
main.c: In function 'norm':
main.c:17:21: error: implicit declaration of function 'norm2'; did you mean 'norm'? [-Wimplicit-function-declaration]
   17 |         return sqrt(norm2(a));
      |                     ^~~~~
      |                     norm
Language: C

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#define max(a,b) a<b?b:a
#define min(a,b) a<b?a:b
#define POW2(a)  a*a
#define ROOP(i,n) for(i = 0;i < n;i++)
#define _USE_MATH_DEFINES

typedef struct POINT{
	double x;
	double y;
}POINT;

//????????????????????¢
double norm(POINT a){
	return sqrt(norm2(a));
}

//a->b?????´??§???????????????
POINT make_vec(POINT a,POINT b){
	b.x -= a.x;
	b.y -= a.y;
	return b;
}

double distance(POINT a,POINT b){
	return norm(make_vec(a,b));
}


double diameter_poly(POINT p[],int n){
	POINT g[n];
	int i,j;
	double m = -1.0;
	for(i = 0;i < n;i++){
		for(j = i+1;j < n;j++){
			m = max(distance(p[i],p[j]),m);
		}
	}
	return m;
}

int main(){
	int k;
	int i;
	POINT p[101];
	scanf("%d",&k);
	for(i =0 ;i < k;i++){
		scanf("%lf%lf",&p[i].x,&p[i].y);
	}
	printf("%.10lf\n",diameter_poly(p,k));
	return 0;
}

Compiler output:
main.c: In function 'norm':
main.c:17:21: error: implicit declaration of function 'norm2'; did you mean 'norm'? [-Wimplicit-function-declaration]
   17 |         return sqrt(norm2(a));
      |                     ^~~~~
      |                     norm
Language: C++

import java.lang.Math.sqrt

data class Point(val x:Double, val y:Double)
fun Point.distanceFrom(origin:Point):Double = sqrt((this.x - origin.x) * (this.x - origin.x) + (this.y - origin.y) * (this.y - origin.y))
fun main(args:Array<String>):Unit {
    val n = readLine()!!.toInt()
    val points = Array(n){readLine()!!.split(' ').map(String::toDouble).let{Point(it.first(), it.last())}}
    var posB = 0
    var maxLength:Double = .0
    for (posA in 0 until n){
        while (points[posA].distanceFrom(points[posB]) <= points[posA].distanceFrom(points[(posB + 1) % n])) {
            posB = (posB + 1) % n
        }
        if (maxLength < points[posA].distanceFrom(points[posB])) maxLength = points[posA].distanceFrom(points[posB])
    }
    println(maxLength)
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.lang.Math.sqrt
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

import java.lang.Math.*

data class Point(val x:Double, val y:Double)
fun Point.distanceFrom(origin:Point):Double = sqrt((this.x - origin.x) * (this.x - origin.x) + (this.y - origin.y) * (this.y - origin.y))
fun main(args:Array<String>):Unit {
    val n = readLine()!!.toInt()
    val points = Array(n){readLine()!!.split(' ').map(String::toDouble).let{Point(it.first(), it.last())}}
    var posB = 0
    var maxLength:Double = .0
    for (posA in 0 until n){
        while (points[posA].distanceFrom(points[posB]) <= points[posA].distanceFrom(points[(posB + 1) % n])) {
            posB = (posB + 1) % n
        }
        if (maxLength < points[posA].distanceFrom(points[posB])) maxLength = points[posA].distanceFrom(points[posB])
    }
    println(maxLength)
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.lang.Math.*
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: Java

3
0 0
1 0
0 1
20
0 0 0 10
0 0 1 10
0 0 1 100
0 0 1 1000
0 0 2 80
0 0 2 10
0 0 3 120
0 0 3 50
0 0 4 25
0 0 5 8
0 0 5 5
0 0 8 4
0 0 25 16
0 0 82 24
0 0 100 5
0 0 100 4
0 0 100 3
0 0 100 2
0 0 100 1
0 0 100 0

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
3
^
1 error
Language: C++

#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
const double pi = acos(-1);
const double EPS = 1e-10;

struct pot{
  ld x,y;
  pot operator+(pot& a){
    pot b;
    b.x = x + a.x;
    b.y = y + b.y;
    return b;
  }
};
pot q1,q2;
pot add(pot a,pot b){
  pot res;
  res.x = a.x + b.x;
  res.y = a.y + b.y;
  return res;
}
pot mani(ld b,pot a){
  pot res;
  res.x = a.x * b;
  res.y = a.y * b;
  return res;
}
ld cross(pot p1,pot p2){
  return p1.x*p2.y -p2.x*p1.y;
}
pot line(pot a,pot b){
  pot res;
  res.x = b.x-a.x;
  res.y = b.y-a.y;
  return res;
}
int judge(pot c,pot a = q1,pot b = q2){
  ld f;
  f = cross(line(a,b),line(a,c));
  if (f > EPS) {
    return 1; //left
  } else if (f < -EPS) {
    return -1; // right
  } else {
    return 0; // center
  }
}
pot inter(pot gi,pot g){
  pot lq = line(q1,q2);
  pot lg = line(g,gi);
  ld k;
  if(lg.y != 0 && lq.x*lg.y != lq.y){
    k = (q1.y-g.y)lg.x/lg.y + g.x-q1.x;
    k /= lq.x-lq.y*lg.x/lg.y;
  } else{
    k = (g.y-q1.y)/lq.y;
  }
  pot res = add(mani(1.0-k,q1),mani(k,q2));
  return res;
}
ld area(vector<pot> a){
  ld s = 0;
  a.pb(a.front());
  REP(i,(int)a.size()-1){
    s += cross(a[i],a[i+1]);
  }
  s /= 2;
  return s;
}

int main(){
  int m;
  cin >> m;
  vector<pot> g(m);
  vector<pot> ans;
  REP(i,m) cin >> g[i].x >> g[i].y;
  g.pb(g.front());
  int n;
  cin >> n;
  REP(k,n){
    cin >> q1.x >> q1.y >> q2.x >> q2.y;
    FOR(i,1,m+1){
      if (judge(g[i]) > 0 && judge(g[i-1]) < 0) {
        ans.pb(inter(g[i],g[i-1]));
      }
      if (judge(g[i]) >= 0) {
        ans.pb(g[i]);
      } else if(judge(g[i]) * judge(g[i-1]) == -1){
        ans.pb(inter(g[i],g[i-1]));
      }
    }
    ld sum;
    sum = area(ans);
    printf("%.8Lf\n",sum );
    ans.clear();
  }
  
}


Compiler output:
a.cc: In function 'pot inter(pot, pot)':
a.cc:64:19: error: expected ';' before 'lg'
   64 |     k = (q1.y-g.y)lg.x/lg.y + g.x-q1.x;
      |                   ^~
      |                   ;
Language: C++

#include<bits/stdc++.h>
using namespace std;

struct A
{
 int x;
};

void test(A &a) {}

int main()
{
 test(A());
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: cannot bind non-const lvalue reference of type 'A&' to an rvalue of type 'A'
   13 |  test(A());
      |       ^~~
a.cc:9:14: note:   initializing argument 1 of 'void test(A&)'
    9 | void test(A &a) {}
      |           ~~~^
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef pair<double,double> P;

bool pariCompare (const P& FElof, const P& SElof) {
    if (FElof.first == SElof.first) return FElof.second < SElof.second;
    return FElof.first < SElof.first;
}

int main ()
{
    int n;
    cin >> n;
    vector<P> p(n);
    for (int i = 0; i < n; i++) {
	cin >> p[i].first >> p[i].second;
    }

    sort(p.begin(), p.end(), pariCompare);

    double dis = 100000.0;
    for (int i = 0; i < n-1; i++) {
	for (int j = i + 1; j < n && p[i].first - p[j].first < ans; j++) {
            double tmp = pow(p[i].first - p[j].first, 2.0) + pow(p[i].second - p[j].second, 2.0);
	    dis = min(dis, tmp);
	}
    }

    printf("%.7f\n", sqrt(dis));

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:64: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |         for (int j = i + 1; j < n && p[i].first - p[j].first < ans; j++) {
      |                                                                ^~~
      |                                                                abs
Language: C++

// http://ir5.hatenablog.com/entry/20131221/1387557630
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>
#include <utility>
#include <cmath>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define DEBUG(x) cerr << #x << " = " << x << endl
typedef pair<double, double> P;
typedef pair<int, int> IP;
double norm(P a, P b) {
  double x = a.first - b.first;
  double y = a.second - b.second;
  return sqrt(x*x + y*y);
}
template <>
class hash<std::pair<int, int>> {
  public:
    size_t operator()(const std::pair<int, int>& x) const {
      return hash<int>()(x.first) ^ hash<int>()(x.second);
    }
};
int main() {
  int N; cin >> N;
  vector<P> p(N);
  REP(i,N) {
    double x, y; cin >> x >> y;
    p[i] = make_pair(x, y);
  }
  double xmin = p[0].first, ymin = p[0].second;
  REP(i,N) {
    xmin = min(xmin, p[i].first);
    ymin = min(ymin, p[i].second);
  }
  REP(i,N) {
    p[i].first -= xmin;
    p[i].second -= ymin;
  }
  // std::rand is often used.
  random_shuffle(p.begin(), p.end());
  double delta = norm(p[0], p[1]);
  unordered_map<IP, vector<int>> S;
  S[IP(p[0].first / delta, p[0].second / delta)].push_back(0);
  S[IP(p[1].first / delta, p[1].second / delta)].push_back(1);
  for(int i = 2; i < N; ++i) {
    IP ip(p[i].first / delta, p[i].second / delta);
    bool update = false;
    for(int dx = -1; dx <= 1; ++dx) for(int dy = -1; dy <= 1; ++dy) {
      for(int j : S[IP(ip.first + dx, ip.second + dy)]) {
        double d2 = norm(p[i], p[j]);
        if(delta > d2) {
          delta = d2;
          update = true;
        }
      }
    }
    if(update) {
      S.clear();
      for(int j = 0; j <= i; ++j) {
        S[IP(p[j].first / delta, p[j].second / delta)].push_back(j);
      }
    }
    else {
      S[ip].push_back(i);
    }
  }
  cout.setf(ios::fixed);
  cout.precision(6);
  cout << delta << endl;
}

Compiler output:
a.cc:20:7: error: explicit specialization of 'template<class _Tp> struct std::hash' outside its namespace must use a nested-name-specifier [-fpermissive]
   20 | class hash<std::pair<int, int>> {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:43:17: warning: 'void std::random_shuffle(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<pair<double, double>*, vector<pair<double, double> > >]' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
   43 |   random_shuffle(p.begin(), p.end());
      |   ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4492:5: note: declared here
 4492 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~