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

#include<bits/stdc++.h>
#define sortv(x) sort((x).begin(), (x).end())
using namespace std;

const double INF = 1e12;


int main()
{
    int N;
    cin >> N;
    vector<double> lx, ly, rx, ry, ux, uy, dx, dy;
    for (int i = 0; i < N; i++)
    {
        double x, y;
        char d;
        cin >> x >> y >> d;
        if (d == 'R')
            rx.push_back(x), ry.push_back(y);
        if (d == 'L')
            lx.push_back(x), ly.push_back(y);
        if (d == 'U')
            ux.push_back(x), uy.push_back(y);
        if (d == 'D')
            dx.push_back(x), dy.push_back(y);
    }
    sortv(rx);
    sortv(lx);
    sortv(ux);
    sortv(dx);
    sortv(ry);
    sortv(ly);
    sortv(uy);
    sortv(dy);
    
    double min_area = -1;
    double t = 0;
    while (true)
    {
        double right, left, upper, bottom;
        right = left = upper = bottom = INF;

        if (rx.size() > 0 )
        {
            right = (right == INF)? rx[rx.size() - 1] + t : max(rx[rx.size() - 1] + t, right);
            left = (left == INF)? rx[0] + t: min(rx[0] + t, left);
            upper = (upper == INF)? ry[ry.size() - 1] : max(ry[ry.size() - 1], upper);
            bottom = (bottom == INF)? ry[0]: min(ry[0], bottom);
        }
        if (lx.size() > 0)
        {
            right = (right == INF)? lx[lx.size() - 1] - t : max(lx[lx.size() - 1] - t, right);
            left = (left == INF)? lx[0] - t: min(lx[0] - t, left);
            upper = (upper == INF)? ly[ly.size() - 1] : max(ly[ly.size() - 1], upper);
            bottom = (bottom == INF)? ly[0]: min(ly[0], bottom);
        }
        if (ux.size() > 0)
        {
            right = (right == INF)? ux[ux.size() - 1] : max(ux[ux.size() - 1], right);
            left = (left == INF)? ux[0]: min(ux[0], left);
            upper = (upper == INF)? uy[uy.size() - 1] + t : max(uy[uy.size() - 1] + t, upper);
            bottom = (bottom == INF)? uy[0] + t: min(uy[0] + t, bottom);
        }
        if (dx.size() > 0)
        {
            right = (right == INF)? dx[dx.size() - 1] : max(dx[dx.size() - 1], right);
            left = (left == INF)? dx[0]: min(dx[0], left);
            upper = (upper == INF)? dy[dy.size() - 1] - t: max(dy[dy.size() - 1] - t, upper);
            bottom = (bottom == INF)? dy[0] - t: min(dy[0] - t, bottom);
        }

        double area = abs(left - right) * abs(upper - bottom);
        t += 0.5;
        // cout << area << ' ' << abs(left - right) * abs(upper - bottom) << endl;
        if (min_area == -1 or min_area >= area)
            min_area = area;
        else
            break;
    }
    printf("%.10f", min_area)
    cout << min_area << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:80:30: error: expected ';' before 'cout'
   80 |     printf("%.10f", min_area)
      |                              ^
      |                              ;
   81 |     cout << min_area << endl;
      |     ~~~~
Language: C++

#include <bits/stdc++.h>
//#include <ext/numeric>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define oo 0x3f3f3f3f
#define OO 0x3f3f3f3f3f3f3f3f
#define popcount(n) __builtin_popcount(n)
#define popcountll(n) __builtin_popcountll(n)

using namespace std;
//using namespace __gnu_cxx;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const double PI = acos(-1.0), EPS = 1e-6;
const long long inf = 2e12 + 12;
const int MAXN = 1000006, MAXM = 1003, Mod = 1000000007 , MAXLog = 20;


double area(int n, vector<pair<pair<int, int>, char>> &arr, double moment) {
    double mnx = LLONG_MAX, mxx = LLONG_MIN, mny = LLONG_MAX, mxy = LLONG_MIN;
    for (int i = 0; i < n; ++i) {
        double x = arr[i].first.first;
        double y = arr[i].first.second;
        if (arr[i].second == 'R') {
            x += moment
        } else if (arr[i].second == 'L') {
            x -= moment;
        } else if (arr[i].second == 'U') {
            y += moment;
        } else {
            y -= moment;
        }
        mnx = min(mnx, x);
        mxx = max(mxx, x);
        mny = min(mny, y);
        mxy = max(mxy, y);
    }
//    cout << mxx << ' ' << mnx << ' ' << mxy << ' ' << mny << '\n';
    return 1.0 * (mxx - mnx) * (mxy - mny);
}


int main() {
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "rt", stdin);
//    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0), cout.precision(9), cout << fixed;

    int n;
    cin >> n;
    vector<pair<pair<int, int>, char>> arr(n);
    for (int i = 0; i < n; ++i) {
        cin >> arr[i].first.first >> arr[i].first.second >> arr[i].second;
    }

    double l = 0, r = inf;
    for (int i = 0; i < 300; ++i) {
        double m1 = ( l * 2 + r ) / 3;
        double m2 = ( l + r * 2 ) / 3;
        if (area(n, arr, m1) > area(n, arr, m2)) {
            l = m1;
        } else {
            r = m2;
        }
    }

    cout << area(n, arr, l) << '\n';

    return 0;
}

Compiler output:
a.cc: In function 'double area(int, std::vector<std::pair<std::pair<int, int>, char> >&, double)':
a.cc:27:24: error: expected ';' before '}' token
   27 |             x += moment
      |                        ^
      |                        ;
   28 |         } else if (arr[i].second == 'L') {
      |         ~
Language: C++

#include <bits/stdc++.h>
const int INF=1e9;
const int MOD=1e9+7;
//const int MOD=998244353;
const long long LINF=1e18;
using namespace std;
#define int long double
//template

//main
signed main(){
  int N;cin>>N;
  std::vector<int> x(N),y(N);
  std::vector<char> q(N);
  for(int i=0;i<N;i++)cin>>x[i]>>y[i]>>q[i];
  char u,d,l,r;u='U';d='D';l='L';r='R';
  int uyM,uym,dyM,dym,ayM,aym;
  int lxM,lxm,rxM,rxm,axM,axm;
  uyM=dyM=ayM=lxM=rxM=axM=-LINF;
  uym=dym=aym=lxm=rxm=axm=LINF;
  for(int i=0;i<N;i++){
    if(q[i]==u){
      uyM=max(uyM,y[i]);
      uym=min(uym,y[i]);
      axM=max(axM,x[i]);
      axm=min(axm,x[i]);
    }
    if(q[i]==l){
      ayM=max(ayM,y[i]);
      aym=min(aym,y[i]);
      lxM=max(lxM,x[i]);
      lxm=min(lxm,x[i]);
    }
    if(q[i]==d){
      dyM=max(dyM,y[i]);
      dym=min(dym,y[i]);
      axM=max(axM,x[i]);
      axm=min(axm,x[i]);
    }
    if(q[i]==r){
      ayM=max(ayM,y[i]);
      aym=min(aym,y[i]);
      rxM=max(rxM,x[i]);
      rxm=min(rxm,x[i]);
    }
  }
  std::vector<int> t(9,0);
  t[0]=lym-uym;
  t[1]=(dym-uym)/2;
  t[2]=dyM-lyM;
  t[3]=(dyM-uyM)/2;
  t[4]=lxM-uxM;
  t[5]=(lxM-rxM)/2;
  t[6]=uxm-rxm;
  t[7]=(lxm-rxm)/2;
  int ans=LINF;
  for(int p:t){
    if(p<0)continue;
    int xM=max({axM,lxM-p,rxM+p});
    int xm=min({axm,lxm-p,rxm+p});
    int yM=max({uyM+p,ayM,dyM-p});
    int ym=min({uym+p,aym,dym-p});
    ans=min(ans,(xM-xm)*(yM-ym));
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:8: error: 'lym' was not declared in this scope; did you mean 'lxm'?
   48 |   t[0]=lym-uym;
      |        ^~~
      |        lxm
a.cc:50:12: error: 'lyM' was not declared in this scope; did you mean 'lxM'?
   50 |   t[2]=dyM-lyM;
      |            ^~~
      |            lxM
a.cc:52:12: error: 'uxM' was not declared in this scope; did you mean 'axM'?
   52 |   t[4]=lxM-uxM;
      |            ^~~
      |            axM
a.cc:54:8: error: 'uxm' was not declared in this scope; did you mean 'axm'?
   54 |   t[6]=uxm-rxm;
      |        ^~~
      |        axm
Language: C++

#include <bits/stdc++.h>
const int INF=1e9;
const int MOD=1e9+7;
//const int MOD=998244353;
const long long LINF=1e18;
using namespace std;
#define int long double
//template

//main
signed main(){
  int N;cin>>N;
  std::vector<int> x(N),y(N);
  std::vector<char> q(N);
  for(int i=0;i<N;i++)cin>>x[i]>>y[i]>>q[i];
  char u,d,l,r;u='U';d='D';l='L';r='R';
  int uyM,uym,dyM,dym,ayM,aym;
  int lxM,lxm,rxM,rxm,axM,axm;
  uyM=dyM=lyM=lxM=rxM=uxM=-LINF;
  uym=dym=lym=lxm=rxm=uxm=LINF;
  for(int i=0;i<N;i++){
    if(q[i]==u){
      uyM=max(uyM,y[i]);
      uym=min(uym,y[i]);
      axM=max(axM,x[i]);
      axm=min(axm,x[i]);
    }
    if(q[i]==l){
      ayM=max(ayM,y[i]);
      aym=min(aym,y[i]);
      lxM=max(lxM,x[i]);
      lxm=min(lxm,x[i]);
    }
    if(q[i]==d){
      dyM=max(dyM,y[i]);
      dym=min(dym,y[i]);
      axM=max(axM,x[i]);
      axm=min(axm,x[i]);
    }
    if(q[i]==r){
      ayM=max(ayM,y[i]);
      aym=min(aym,y[i]);
      rxM=max(rxM,x[i]);
      rxm=min(rxm,x[i]);
    }
  }
  std::vector<int> t(9,0);
  t[0]=lym-uym;
  t[1]=(dym-uym)/2;
  t[2]=dyM-lyM;
  t[3]=(dyM-uyM)/2;
  t[4]=lxM-uxM;
  t[5]=(lxM-rxM)/2;
  t[6]=uxm-rxm;
  t[7]=(lxm-rxm)/2;
  int ans=LINF;
  for(int p:t){
    if(p<0)continue;
    int xM=max({axM,lxM-p,rxM+p});
    int xm=min({axm,lxm-p,rxm+p});
    int yM=max({uyM+p,ayM,dyM-p});
    int ym=min({uym+p,aym,dym-p});
    ans=min(ans,(xM-xm)*(yM-ym));
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: 'lyM' was not declared in this scope; did you mean 'lxM'?
   19 |   uyM=dyM=lyM=lxM=rxM=uxM=-LINF;
      |           ^~~
      |           lxM
a.cc:19:23: error: 'uxM' was not declared in this scope; did you mean 'axM'?
   19 |   uyM=dyM=lyM=lxM=rxM=uxM=-LINF;
      |                       ^~~
      |                       axM
a.cc:20:11: error: 'lym' was not declared in this scope; did you mean 'lxm'?
   20 |   uym=dym=lym=lxm=rxm=uxm=LINF;
      |           ^~~
      |           lxm
a.cc:20:23: error: 'uxm' was not declared in this scope; did you mean 'axm'?
   20 |   uym=dym=lym=lxm=rxm=uxm=LINF;
      |                       ^~~
      |                       axm
Language: C++

#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pb push_back
#define sz(i) (int)(i.size())
#define x first
#define y second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = (int)1e5 + 10;

#define double long double
int n;
char d[N];
P pt[N];

double f(double till){
   double x[2], y[2];
   x[0] = 1e20;//min
   x[1] = -1e20;//max
   y[0] = 1e20;
   y[1] = -1e20;

   for (int i = 0; i < n; ++i)
   {
      double ptx = pt[i].x, pty = pt[i].y;
      if (d[i] == 'R'){
         ptx += till;
      }
      else if (d[i] == 'L'){
         ptx -= till;
      }
      else if (d[i] == 'U'){
         pty += till;
      }
      else{
         pty -= till;
      }
      smax(x[1], ptx);
      smin(x[0], ptx);
      smax(y[1], pty);
      smin(y[0], pty);
   }

   return (long double) (x[1] - x[0]) * (long double) (y[1] - y[0]);
}

double binary_search(double A, double B){
   double ans = 0;

   for (int i = 0; i < 300; ++i)
   {
      double m1 = (A * 2 + B) / 3.0;
      double m2 = (A + 2 * B) / 3.0;
      if (f(m1) > f(m2)){
         ans = m1;
         A = m1;
      }
      else{
         B = m2;
      }
   }

   return f(ans);
}

int32_t main(){_

   cout << fixed << setprecision(15);
   cin>>n;

   for (int i = 0; i < n; ++i)
   {
      cin>>pt[i].x>>pt[i].y>>d[i];
   }   

   cout<<binary_search(0, 1e18);

   return 0;
}

Compiler output:
a.cc: In function 'long double f(long double)':
a.cc:22:16: error: 'long long' specified with 'double'
   22 | #define double long double
      |                ^~~~
a.cc:55:17: note: in expansion of macro 'double'
   55 |    return (long double) (x[1] - x[0]) * (long double) (y[1] - y[0]);
      |                 ^~~~~~
a.cc:22:16: error: 'long long' specified with 'double'
   22 | #define double long double
      |                ^~~~
a.cc:55:47: note: in expansion of macro 'double'
   55 |    return (long double) (x[1] - x[0]) * (long double) (y[1] - y[0]);
      |                                               ^~~~~~
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<double, ll> state;
typedef vector<vector<ll>> matrix;

int x[100005];
int y[100005];
string d[100005];
int n;

double getArea(double t) {
  double xMax = -1e9;
  double xMin = 1e9;
  double yMax = -1e9;
  double yMin = 1e9;
  for(int i = 0; i < n; i++) {
    double xx = x[i];
    double yy = y[i];
    if(d[i] == "R") xx += t;
    if(d[i] == "L") xx -= t;
    if(d[i] == "U") yy += t;
    if(d[i] == "D") yy -= t;
    xMax = max(xMax, xx);
    xMin = min(xMin, xx);
    yMax = max(yMax, yy);
    yMin = min(yMin, yy);
  }
  return (xMax-xMin) * (yMax-yMin);
}

void solve() {
  cin >> n;
  for(int i = 0; i < n; i++) cin >> x[i] >> y[i] >> d[i];
  double lhs = 0;
  double rhs = 2e8;
  double ret = solve(0);
  for(int qq = 0; qq < 200; qq++) {
    double a = (2*lhs+rhs)/3;
    double b = (2*rhs+lhs)/3;
    ret = min(ret, getArea(a));
    ret = min(ret, getArea(b));
    if(getArea(a) <= getArea(b)) rhs = b;
    else lhs = a;
  }
  cout << fixed << setprecision(10) << ret << "\n";
}

void casesolve() {
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  // casesolve();
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:51:21: error: too many arguments to function 'void solve()'
   51 |   double ret = solve(0);
      |                ~~~~~^~~
a.cc:46:6: note: declared here
   46 | void solve() {
      |      ^~~~~
a.cc:51:21: error: void value not ignored as it ought to be
   51 |   double ret = solve(0);
      |                ~~~~~^~~
Language: C++

#pragma GCC optimize "O3"
#pragma GCC optimize "unroll-loops"
#pragma GCC target "sse,sse2,sse3,sse4,avx,abm,mmx,popcnt,tune=native"
#include<algorithm>
#include<cmath>
#include<cstdio>
typedef long double llf;
const int MN=1e5+4;
const llf INF=1e100,EPS=1e-12,GR=(1+sqrt(5))/2.0;
int N;
llf ans=INF;
struct pnt {
    llf x, y;
    llf ox,oy;
    char c;
}pnts[MN];
static inline void mov(pnt &p,llf dt) {
    switch(p.c) {
        case 'R':
            p.x=p.ox+dt;
            p.y=p.oy;
            break;
        case 'L':
            p.x=p.ox-dt;
            p.y=p.oy;
            break;
        case 'U':
            p.x=p.ox;
            p.y=p.oy+dt;
            break;
        case 'D':
            p.x=p.ox;
            p.y=p.oy-dt;
            break;
    }
}
static inline llf bb() {
    llf mxx=-INF,mxy=-INF,mnx=INF,mny=INF;
    for(int i=0;i<N;++i) {
        mxx=std::max(mxx,pnts[i].x);
        mnx=std::min(mnx,pnts[i].x);
        mxy=std::max(mxy,pnts[i].y);
        mny=std::min(mny,pnts[i].y);
    }
    return (mxx-mnx)*(mxy-mny);
}
int main() {
    scanf("%d",&N);
    for(int i=0;i<N;++i) {
        scanf("%Lf %Lf %c",&pnts[i].ox,&pnts[i].oy,&pnts[i].c);
    }
    // do GSS
    llf lo=0,hi=1e9,mi1,mi2;
    while(fabs(hi-lo)>EPS) {
        mi1=b-(b-a)/GR;
        mi2=a+(b-a)/GR;
        llf b1,b2;
        for(int i=0;i<N;++i)
            mov(pnts[i],mi1);
        b1=bb();
        for(int i=0;i<N;++i)
            mov(pnts[i],mi2);
        b2=bb();
        if(b1<b2) hi=mi2;
        else lo=mi1;
        ans=std::min(std::min(b1,b2),ans);
    }
    printf("%.9Lf\n",ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:13: error: 'b' was not declared in this scope; did you mean 'bb'?
   55 |         mi1=b-(b-a)/GR;
      |             ^
      |             bb
a.cc:55:18: error: 'a' was not declared in this scope
   55 |         mi1=b-(b-a)/GR;
      |                  ^
Language: C++

#include <bits/stdc++.h>
const int INF=1e9;
const int MOD=1e9+7;
//const int MOD=998244353;
const long long LINF=1e18;
using namespace std;
#define int long double
//template

//main
signed main(){
  int N;cin>>N;
  std::vector<int> x(N),y(N);
  std::vector<char> q(N);
  for(int i=0;i<N;i++)cin>>x[i]>>y[i]>>q[i];
  char u,d,l,r;u='U';d='D';l='L';r='R';
  int uyM,uym,dyM,dym,lyM,lym;
  int lxM,lxm,rxM,rxm,uxM,uxm;
  uyM=dyM=lyM=lxM=rxM=uxM=-LINF;
  uym=dym=lym=lxm=rxm=uxm=LINF;
  for(int i=0;i<N;i++){
    if(q[i]==u){
      uyM=max(uyM,y[i]);
      uym=min(uym,y[i]);
      uxM=max(uxM,x[i]);
      uxm=min(uxm,x[i]);
    }
    if(q[i]==l){
      lyM=max(lyM,y[i]);
      lym=min(lym,y[i]);
      lxM=max(lxM,x[i]);
      lxm=min(lxm,x[i]);
    }
    if(q[i]==d){
      dyM=max(dyM,y[i]);
      dym=min(dym,y[i]);
      uxM=max(uxM,x[i]);
      uxm=min(uxm,x[i]);
    }
    if(q[i]==r){
      lyM=max(lyM,y[i]);
      lym=min(lym,y[i]);
      rxM=max(rxM,x[i]);
      rxm=min(rxm,x[i]);
    }
  }
  int yMult,yMudt,yMdlt;
  int ymult,ymudt,ymdlt;
  int xMrut,xMlut,xMrlt;
  int xmrut,xmlut,xmrlt;

  for(int i=0;i<4e8;i++){
    int xM=max({uxM,lxM-i,rxM+i});
    int xm=min({uxm,lxm-i,rxm+i});
    int yM=max({uyM+i,lyM,dyM-i});
    int ym=min({uym+i,lym,dym-i});
    ans=min(ans,(xM-xm)*(yM-ym));
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   57 |     ans=min(ans,(xM-xm)*(yM-ym));
      |     ^~~
      |     abs
a.cc:59:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   59 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

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

using i64 = int64_t;

constexpr long double EPS = 1e-10;

long double f(long double tm, const vector<pair<i64, i64>> &v, const vector<int> &dir){
    long double xmin = 1e10, xmax = -1e10, ymin = 1e10, ymax = -1e10;
    for(int i=0;i<v.size();++i){
        long double x = v[i].first, y = v[i].second;
        if(dir[i] == 0)y += tm;
        else if(dir[i] == 1)x += tm;
        else if(dir[i] == 2)y -= tm;
        else x -= tm;
        xmin = min(xmin, x);
        xmax = max(xmax, x);
        ymin = min(ymin, y);
        ymax = max(ymax, y);
    }
    return (xmax-xmin) * (ymax-ymin);
}

int main(){
    int n;
    cin >> n;
    vector<pair<i64, i64>> v;
    vector<int> dir;
    for(int i=0;i<n;++i){
        i64 x, y;
        char c;
        cin >> x >> y >> c;
        v.emplace_back(x, y);
        int d;
        if(c == 'U')d = 0;
        else if(c == 'R')d = 1;
        else if(c == 'D')d = 2;
        else d = 3;
        dir.push_back(d);a
    }

    long double left = 0, right = 1e9, phi = (1.0+sqrt(5))/2.0;
    while(right - left > EPS){
        long double t1 = (phi*left + right) / (1.0+phi);
        long double t2 = (left + phi * right) / (1.0+phi);
        if(f(t1, v, dir) > f(t2, v, dir))left = t1;
        else right = t2;
    }
    printf("%.10f\n", f(left, v, dir));

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:26: error: 'a' was not declared in this scope
   39 |         dir.push_back(d);a
      |                          ^
Language: C++

#include <bits/stdc++.h>

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define INF  numeric_limits<int>::max()
#define NINF numeric_limits<int>::min()

using namespace std;
using ll = long long;

struct pt {
    int  x;
    int  y;
    char dir;
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    vector<pt> pts;
    REP(i, N) {
        int x, y;
        char d;
        std::cin >> x >> y >> d;
        pts.push_back(pt{x, y, d});
    }

    int r_x_max = NINF;
    int r_x_min = INF;
    int l_x_max = NINF;
    int l_x_min = INF;
    int u_y_max = NINF;
    int u_y_min = INF;
    int d_y_max = NINF;
    int d_y_min = INF;
    REP(i, N) {
        if(pts[i].dir == 'R' && r_x_max < pts[i].x) {
            r_x_max = pts[i].x;
        }
        if(pts[i].dir == 'R' && pts[i].x < r_x_min) {
            r_x_min = pts[i].x;
        }
        if(pts[i].dir == 'L' && l_x_max < pts[i].x) {
            l_x_max = pts[i].x;
        }
        if(pts[i].dir == 'L' && pts[i].x < l_x_min) {
            l_x_min = pts[i].x;
        }
        if(pts[i].dir == 'U' && u_y_max < pts[i].y) {
            u_y_max = pts[i].y;
        }
        if(pts[i].dir == 'U' && pts[i].y < u_y_min) {
            u_y_min = pts[i].x;
        }
        if(pts[i].dir == 'D' && d_y_max < pts[i].y) {
            d_y_max = pts[i].y;
        }
        if(pts[i].dir == 'D' && pts[i].y < d_y_min) {
            d_y_min = pts[i].x;
        }
    }

    std::cout << std::abs(r_x_max + l_x_max) / 2.0 - r_x_min + l_x_min / 2.0) *
        std::abs(u_y_max + d_y_max / 2.0 - u_y_min + d_y_min / 2.0) << std::endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:77: error: expected ';' before ')' token
   64 |     std::cout << std::abs(r_x_max + l_x_max) / 2.0 - r_x_min + l_x_min / 2.0) *
      |                                                                             ^
      |                                                                             ;
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        ArrayList<Po>u=new ArrayList<>();
        ArrayList<Po>d=new ArrayList<>();
        ArrayList<Po>r=new ArrayList<>();
        ArrayList<Po>l=new ArrayList<>();
        for(int i=0;i<n;i++){
            int a=sc.nextInt();
            int b=sc.nextInt();
            String c=sc.next();
            if(c.equals("D"))d.add(new Po(a,b));
            if(c.equals("L"))l.add(new Po(a,b));
            if(c.equals("R"))r.add(new Po(a,b));
            if(c.equals("U"))u.add(new Po(a,b));
        }
        int uu=Integer.MIN_VALUE,dd=Integer.MAX_VALUE,ll=Integer.MAX_VALUE,rr=Integer.MIN_VALUE;
        int a1=Integer.MIN_VALUE;
        int a2=Integer.MAX_VALUE;
        int ddd,uuu,rrr,lll;
        for(int i=0;i<d.size();i++){
            if(a1<d.get(i).y)a1=d.get(i).y;
            if(a2>d.get(i).y)a1=d.get(i).y;
            
            if(rr<d.get(i).x)rr=d.get(i).x;
            if(ll>d.get(i).x)ll=d.get(i).x;
        }
        if(a1!=Integer.MIN_VALUE){
            ddd=a1-a2;
        }
        a1=Integer.MIN_VALUE;
       a2=Integer.MAX_VALUE;
        else ddd=Integer.MAXVALUE;
        for(int i=0;i<u.size();i++){
            if(a1<u.get(i).y)a1=u.get(i).y;
            if(a2>u.get(i).y)a1=u.get(i).y;
            if(rr<u.get(i).x)rr=u.get(i).x;
            if(ll>u.get(i).x)ll=u.get(i).x;
        }
        if(a1!=Integer.MIN_VALUE){
            uuu=a1-a2;
        }
        a1=Integer.MIN_VALUE;
       a2=Integer.MAX_VALUE;
        for(int i=0;i<r.size();i++){
            if(a1<r.get(i).x)a1=r.get(i).x;
            if(a2>r.get(i).x)a1=r.get(i).x;
            if(uu<r.get(i).y)uu=r.get(i).y;
            if(dd>r.get(i).y)dd=r.get(i).y;
        }
        if(a1!=Integer.MIN_VALUE){
            rrr=a1-a2;
        }
        a1=Integer.MIN_VALUE;
       a2=Integer.MAX_VALUE;
        
        for(int i=0;i<l.size();i++){
            if(a1<l.get(i).x)a1=l.get(i).x;
            if(a2>l.get(i).x)a1=l.get(i).x;
            if(uu<l.get(i).y)uu=l.get(i).y;
            if(dd>l.get(i).y)dd=l.get(i).y;
        }
        if(a1!=Integer.MIN_VALUE){
            lll=a1-a2;
        }
        int ansy=Math.min(lll,rrr);
        int ansx=Math.min(uuu,ddd);
        ansy=Math.min(ansy,uu-dd);
        ansx=Math.min(ansx,rr-ll);
        System.out.println((double)ansy*ansx/4);
        
        
    }
    
}class Po{
        int x,y;String d;
        public Po(int s,int b){
            x=s;
            y=b;
        }
        public void print(){
            System.out.println(x+" "+y+" "+d);
        }
        
    }


Compiler output:
Main.java:36: error: 'else' without 'if'
        else ddd=Integer.MAXVALUE;
        ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int n;
double x[100010], y[100010];
char d[100010];
 
double solve(double t){
    double xmax, xmin, ymax, ymin;
    xmin = ymin = DBL_MAX;
    xmax = ymax = DBL_MIN;
 
    for(int i = 0;i < n;i++){
        double xtmp = x[i];
        double ytmp = y[i];
 
        if(d[i] == 'R'){
            xtmp += t;
        }else if(d[i] == 'L'){
            xtmp -= t;
        }else if(d[i] == 'U'){
            ytmp += t;
        }else{
            ytmp -= t;
        }
 
        xmax = max(xmax, xtmp);
        xmin = min(xmin, xtmp);
        ymax = max(ymax, ytmp);
        ymin = min(ymin, ytmp);
    }
 
    return (xmax - xmin) * (ymax-ymin);
}
 
int main(){
    cin >> n;
 
    for(int i = 0;i < n;i++){
        cin >> x[i] >> y[i] >> d[i];
    }
 
    double l = 0, r = 1000000000;
 
    while(r-l >= 0.1){
        double tmp = (r-l)/3;
        double mid1 = l + tmp;
        double mid2 = l + tmp*2;
        if(solve(mid1) < solve(mid2)){
            r = mid2;
        }else{
            l = mid1;
        }
    }
 
    double ans = DBL_MAX;
    int tmp = (int)max(0.0, l-5);
    int tmp2 = r+5;
 
    for(double i = tmp;i < tmp2;i+=0.01){
        double tmp = solve(i);
        if(tmp < ans){
            ans = tmp;
        }
    }
 
    //printf("%.12lf\n", min(solve((l+r)/2.0), min(solve(l), solve(r))));
 
    printf("%.12lf\n", ans);
 
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:71:14: error: expected '}' at end of input
   71 |     return 0;
      |              ^
a.cc:36:11: note: to match this '{'
   36 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long

using namespace std;

const ll INF = 1e9;
const double EPS = 0.000000001;

struct Data {
    double x, y,;
    int dir;
};

int xplus[] = {1, -1, 0, 0};
int yplus[] = {0, 0, 1, -1};
int toadd[] = {1, -1, 1, -1};
int n;

double check(double t, const vector<Data> &v, const int dir) {
    double mn = INF, mx = -INF;
    for(int i = 1; i <= n; i ++) {
        double a;
        if(dir == 1)
            a = v[i].x;
        else
            a = v[i].y;
        if(v[i].dir == dir - 1 || v[i].dir == dir) {
            a += (t * toadd[v[i].dir]);
        }

        mn = min(mn, a);
        mx = max(mx, a);
    }

    return (mx - mn);
}

double getsol(double t, vector<Data> v) {
    double minx = INF, maxx = -INF, maxy = -INF, miny = INF;
    for(int i = 1; i <= n; i ++) {
        v[i].x += (xplus[v[i].dir] * t);
        v[i].y += (yplus[v[i].dir] * t);

        minx = min(minx, v[i].x);
        maxx = max(maxx, v[i].x);
        miny = min(miny, v[i].y);
        maxy = max(maxy, v[i].y);
    }

    double ans = (maxx - minx) * (maxy - miny);
    return ans;
}

int main() {
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> n;
    vector<Data> v(n + 1, {0, 0, 0});
    double minx = INF, maxx = -INF, maxy = -INF, miny = INF;
    for(int i = 1; i <= n; i ++) {
        cin >> v[i].x >> v[i].y;
        char d;
        cin >> d;
        if(d == 'R')
            v[i].dir = 0;
        if(d == 'L')
            v[i].dir = 1;
        if(d == 'U')
            v[i].dir = 2;
        if(d == 'D')
            v[i].dir = 3;

        minx = min(minx, v[i].x);
        maxx = max(maxx, v[i].x);
        miny = min(miny, v[i].y);
        maxy = max(maxy, v[i].y);
    }

    double ans = (maxx - minx) * (maxy - miny);

    double tx = 0, ty = 0;
    for(double step = 1 << 28; step >= EPS; step /= 2.0) {
        if(check(tx + step, v, 1) - check(tx + step + EPS * 10, v, 1) >= EPS)
            tx += step;
        if(check(ty + step, v, 3) - check(ty + step + EPS * 10, v, 3) >= EPS)
            ty += step;
    }
    tx += (EPS * 10);
    ty += (EPS * 10);

    ans = min({ans, getsol(tx, v), getsol(ty, v)});
    cout << setprecision(15) << fixed << ans;

    return 0;
}


Compiler output:
a.cc:11:16: error: stray ',' at end of member declaration
   11 |     double x, y,;
      |                ^
      |                -
Language: C++

def noodle(func, l, r):
    for i in range(1000):
        midl, midr = (l * 2 + r) / 3, (l + 2 * r) / 3
        fl = func(l)
        fml = func(midl)
        fmr = func(midr)
        fr = func(r)
        if(fl >= fml >= fmr >= fr):
            l = midl
        elif(fl <= fml <= fmr <= fr):
            r = midr
        elif(fml <= min(fl, fr)):
            r = midr
        else:
            l = midl
    return func(l)
INF = 1 << 30
Rp = []
Lp = []
Dp = []
Up = []

n = int(input())
for i in range(n):
    x, y, d = input().split()
    x = int(x)
    y = int(y)
    if d == 'R':Rp.append((x,y))
    if d == 'L':Lp.append((x,y))
    if d == 'D':Dp.append((x,y))
    if d == 'U':Up.append((x,y))

def area(t):
    up = -INF
    down = INF
    left = INF
    right = -INF
    for x, y in Rp:
        up = max(up, y)
        down = min(down, y)
        left = min(left, x + t)
        right = max(right, x + t)
    for x, y in Lp:
        up = max(up, y)
        down = min(down, y)
        left = min(left, x - t)
        right = max(right, x - t)
    for x, y in Dp:
        up = max(up, y - t)
        down = min(down, y - t)
        left = min(left, x)
        right = max(right, x)
    for x, y in Up:
        up = max(up, y + t)
        down = min(down, y + t)
        left = min(left, x)
        right = max(right, x)

    return (up - down) * (right - left)

print("%.10lf"%noodle(area, 0, INF))
    



Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def noodle(func, l, r):
      | ^~~
Language: C++

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

typedef pair<int, int> P;

int main(){
    int n;
    cin >> n;
    int x, y;
    char d;
    vector<int> updown;
    vector<int> leftright;
    vector<int> up;
    vector<int> down;
    vector<int> left;
    vector<int> right;
    for (int i = 0; i < n; i++){
        cin >> x >> y >> d;
        if (d == 'U' || d == 'D') leftright.push_back(x);
        else updonw.push_back(y);
        if (d == 'U') up.push_back(x);
        else if (d == 'D') donw.push_back(x);
        else if (d == 'L') left.push_back(y);
        else right.push_back(y);
    }
    sort(updown.begin(), updown.end());
    sort(leftright.begin(), leftright.end());
    if (updown.size() == 0 || leftright.size() == 0) cout << 0 << endl;
    else cout << (updonw.back() - updown[0]) * (leftrihgt.back() - leftright[0]) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: 'updonw' was not declared in this scope; did you mean 'updown'?
   20 |         else updonw.push_back(y);
      |              ^~~~~~
      |              updown
a.cc:22:28: error: 'donw' was not declared in this scope; did you mean 'down'?
   22 |         else if (d == 'D') donw.push_back(x);
      |                            ^~~~
      |                            down
a.cc:29:19: error: 'updonw' was not declared in this scope; did you mean 'updown'?
   29 |     else cout << (updonw.back() - updown[0]) * (leftrihgt.back() - leftright[0]) << endl;
      |                   ^~~~~~
      |                   updown
a.cc:29:49: error: 'leftrihgt' was not declared in this scope; did you mean 'leftright'?
   29 |     else cout << (updonw.back() - updown[0]) * (leftrihgt.back() - leftright[0]) << endl;
      |                                                 ^~~~~~~~~
      |                                                 leftright
Language: C++

#include<iostream>
int a,b;
int main()
{
  cin>>a>>b;
  cout<<a-b<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>a>>b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   cout<<a-b<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   cout<<a-b<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>

using namespace std;
using namespace atcoder;

int main(){
    int N,K;
    cin>>N>>K;
    if(K==1) cout<<"0"<<endl;
    else{
        int n=N-K;
        cout<<n<<endl;
    }
}


Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namaspace::std;
int main(){
  int a,b;
cin>>a>>b;
  if(b==1) cout<<0<<endl;
  else{a-=b;
  cout<<a<<endl;}
}


Compiler output:
a.cc:2:7: error: 'namaspace' has not been declared
    2 | using namaspace::std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin>>a>>b;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   if(b==1) cout<<0<<endl;
      |            ^~~~
      |            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   if(b==1) cout<<0<<endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout<<a<<endl;}
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |   cout<<a<<endl;}
      |            ^~~~
      |            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namaspace:std;
int main(){
  int a,b;
cin>>a>>b;
  if(b==1) cout<<0<<endl;
  else{a-=b;
  cout<<a<<endl;}
}


Compiler output:
a.cc:2:16: error: found ':' in nested-name-specifier, expected '::'
    2 | using namaspace:std;
      |                ^
      |                ::
a.cc:2:7: error: 'namaspace' has not been declared
    2 | using namaspace:std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin>>a>>b;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   if(b==1) cout<<0<<endl;
      |            ^~~~
      |            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   if(b==1) cout<<0<<endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout<<a<<endl;}
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |   cout<<a<<endl;}
      |            ^~~~
      |            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namaspace:std
int main(){
  int a,b;
cin>>a>>b;
  if(b==1) cout<<0<<endl;
  else{a-=b;
  cout<<a<<endl;}
}


Compiler output:
a.cc:2:16: error: found ':' in nested-name-specifier, expected '::'
    2 | using namaspace:std
      |                ^
      |                ::
a.cc:2:7: error: 'namaspace' has not been declared
    2 | using namaspace:std
      |       ^~~~~~~~~
a.cc:2:20: error: expected ';' before 'int'
    2 | using namaspace:std
      |                    ^
      |                    ;
    3 | int main(){
      | ~~~                 
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin>>a>>b;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   if(b==1) cout<<0<<endl;
      |            ^~~~
      |            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   if(b==1) cout<<0<<endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout<<a<<endl;}
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |   cout<<a<<endl;}
      |            ^~~~
      |            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
int main(){
  int a,b;
cin>>a>>b;
  if(b==1) cout<<0<<endl;
  else{a-=b;
  cout<<a<<endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 | cin>>a>>b;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   if(b==1) cout<<0<<endl;
      |            ^~~~
      |            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:5:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 |   if(b==1) cout<<0<<endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout<<a<<endl;}
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout<<a<<endl;}
      |            ^~~~
      |            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
main(){
cin>>a>>b;
  if(b==1) cout<<0<<endl;
  else{a-=b;
  cout<<a<<endl;}
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    3 | cin>>a>>b;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:3:6: error: 'a' was not declared in this scope
    3 | cin>>a>>b;
      |      ^
a.cc:3:9: error: 'b' was not declared in this scope
    3 | cin>>a>>b;
      |         ^
a.cc:4:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    4 |   if(b==1) cout<<0<<endl;
      |            ^~~~
      |            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:4:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 |   if(b==1) cout<<0<<endl;
      |                     ^~~~
      |                     std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:6:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   cout<<a<<endl;}
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   cout<<a<<endl;}
      |            ^~~~
      |            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793




int main(){
   int n,k;
   cin >> n >> k;
   if(k==1)cout << 0 <<< endl;
   else{int x=n-(k-1);
   cout << x-1 << endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: expected primary-expression before '<' token
   16 |    if(k==1)cout << 0 <<< endl;
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define int long long
constexpr long long INF = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int  n, k;

    cin>>n>>k;

    cout<<max(n%k,0)<<endl;






}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: no matching function for call to 'max(long long int, int)'
   20 |     cout<<max(n%k,0)<<endl;
      |           ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:20:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   20 |     cout<<max(n%k,0)<<endl;
      |           ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:20:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |     cout<<max(n%k,0)<<endl;
      |           ~~~^~~~~~~