criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
import java.io.*;

public class CF_C {
    public static void main(String[] args) throws Exception {
        FastScanner fs = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        int n = fs.nextInt(), m = fs.nextInt();
        int[][] a = new int[n][2];
        int[][] b = new int[m][2];
        for(int i = 0; i < n; i++) {
            a[i][0] = fs.nextInt(); a[i][1] = fs.nextInt();
        }
        for(int i = 0; i < m; i++) {
            b[i][0] = fs.nextInt(); b[i][1] = fs.nextInt();
        }

        for(int i = 0; i < n; i++) {
            int res = 0, best = (int)2e9+1000;
            for(int j = 0; j < m; j++) {
                int diff = Math.abs(a[i][0] - b[j][0]) + Math.abs(a[i][1] - b[j][1]);
                if(diff < best) {
                    best = diff;
                    res = j;
                }
            }
            out.println(res+1);
        }


        out.close();
    }


    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer("");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String line = "";
            try {
                line = br.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return line;
        }

        public Integer[] nextIntegerArray(int n) {
            Integer[] a = new Integer[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        public char[] nextCharArray() {
            return nextLine().toCharArray();
        }
    }
}


Compiler output:
Main.java:4: error: class CF_C is public, should be declared in a file named CF_C.java
public class CF_C {
       ^
1 error
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char const *argv[])
{
  int n, m, answer[50];
  long a[50], b[50], c[50], d[50];
  int i, j, min, mindex, temp;
  long min, temp;
  scanf("%d%d", &n, &m);
  for(i=0;i<n;i++) {
    scanf("%ld%ld", a+i, b+i);
  }
  for(i=0;i<m;i++) {
    scanf("%ld%ld", c+i, d+i);
  }
  for(i=0;i<n;i++) {
    min = abs(a[i]-c[j]) + abs(b[i]-d[j]);
    mindex = 0;
    for(j=1;j<m;j++) {
      temp = abs(a[i]-c[j]) + abs(b[i]-d[j]);
      if(min > temp) {
        min = temp;
        mindex = j;
      }
    }
    answer[i] = mindex + 1;
  }
  for(i=0;i<n;i++) {
    printf("%d\n", answer[i]);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:8: error: conflicting types for 'min'; have 'long int'
    9 |   long min, temp;
      |        ^~~
main.c:8:13: note: previous declaration of 'min' with type 'int'
    8 |   int i, j, min, mindex, temp;
      |             ^~~
main.c:9:13: error: conflicting types for 'temp'; have 'long int'
    9 |   long min, temp;
      |             ^~~~
main.c:8:26: note: previous declaration of 'temp' with type 'int'
    8 |   int i, j, min, mindex, temp;
      |                          ^~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char const *argv[])
{
  int n, m, a[50], b[50], c[50], d[50], answer[50];
  int i, j, k, min, mindex;
  scanf("%d%d", &n, &m);
  for(i=0;i<n;i++) {
    scanf("%d", a+i, b+i);
  }
  for(i=0;i<m;i++) {
    scanf("%d", c+i, b+i);
  }
  for(i=0;i<n;i++) {
    min = 0;
    mindex = 0:
    for(j=0;j<m;j++) {
      if(min < abs(a[i]-c[j]) - abs(b[i]-c[j])) {
        min = abs(a[i]-c[j]) - abs(b[i]-c[j]);
        mindex = j;
      }
    }
    answer[i] = mindex + 1;
  }
  for(i=0;i<n;i++) {
    printf("%d\n", answer[i]);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:17:15: error: expected ';' before ':' token
   17 |     mindex = 0:
      |               ^
      |               ;
a.cc:18:20: error: expected ';' before ')' token
   18 |     for(j=0;j<m;j++) {
      |                    ^
      |                    ;
Language: C++


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

// 問2

class cPOINT{
public:
	long lnX;
	long lnY;
	cPOINT() { lnX = 0; lnY = 0; };
	cPOINT& operator=(const cPOINT &obj);
	cPOINT operator-(const cPOINT &obj);
	double calc();
};
cPOINT& cPOINT::operator=(const cPOINT &obj)
{
	lnX = obj.lnX;
	lnY = obj.lnY;
	return *this;
}
cPOINT cPOINT::operator-(const cPOINT &obj)
{
	cPOINT cTmp;
	cTmp.lnX =  this->lnX - obj.lnX;
	cTmp.lnY = this->lnY - obj.lnY;
	return cTmp;
}

double cPOINT::calc()
{
	double dbPowX = pow(lnX, 2);
	double dbPowY = pow(lnY, 2);
	return sqrt(dbPowX + dbPowY);
}


int main()
{
	long lnCntN;
	long lnCntM;
	cin >> lnCntN;
	cin >> lnCntM;

	vector<cPOINT> vecN(lnCntN);
	vector<cPOINT> vecM(lnCntM);

	for (int i = 0; i < lnCntN; i++)
	{
		cPOINT stAdd;
		cin >> stAdd.lnX;
		cin >> stAdd.lnY;
		vecN[i] = stAdd;
	}
	for (int i = 0; i < lnCntM; i++)
	{
		cPOINT stAdd;
		cin >> stAdd.lnX;
		cin >> stAdd.lnY;
		vecM[i] = stAdd;
	}

	for (int i = 0; i < lnCntN; i++)
	{
		int nIdxM=0;					// 1番近いチェックポイントデータのIndex;
		double dbNearVal = LONG_MAX;	// 1番近いチェックポイントまでの距離
		for (int j=0; j < lnCntM; j++)
		{
			cPOINT cTmp = vecN[i] - vecM[j];
			double dbVal = cTmp.calc();
			if (dbVal < dbNearVal)
			{
				dbNearVal = dbVal;
				nIdxM = j;
			}
		}
		if (i == lnCntN-1)
			cout << nIdxM + 1;
		else
			cout << nIdxM + 1 << endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:70:36: error: 'LONG_MAX' was not declared in this scope
   70 |                 double dbNearVal = LONG_MAX;    // 1番近いチェックポイントまでの距離
      |                                    ^~~~~~~~
a.cc:7:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <math.h>
  +++ |+#include <climits>
    7 | using namespace std;
Language: Java

import java.util.*;
class Main{
    public static void main(String[]args){
        Scanner cin=new Scanner(System.in);
        int numS;
        int numC;
        int student = new int[];
        int checkp = new int[];
        int count =0;
        int kx;
        int ky;
        int result;
        int temp;
        
        numS = cin.nextInt();
        numC = cin.nextInt();
        for(int i=0;i<numS;i++ ){
            student[count]=cin.nextInt();
            count++;
            student[count]=cin.nextInt();
            count++;
        }
        count = 0;
        for(int j=0;j<numC;j++ ){
            checkp[count]=cin.nextInt();
            count++;
            checkp[count]=cin.nextInt();
            count++;
        }
        for(int k=0;k<numS;k++){
            kx = student[2*k];
            ky = student[2*k+1];
　　　 result = 0;
            temp = 900000000;
            for(int m=0;m<numC;m++){
                if(temp < Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1])){
                    temp = Math.abs(kx-checkp[2*m])+Math.abs(ky-checkp[2*m+1]);
                    result = m
                 }
            }    
            System.out.println(result);
        }
    }
}

Compiler output:
Main.java:7: error: array dimension missing
        int student = new int[];
                               ^
Main.java:8: error: array dimension missing
        int checkp = new int[];
                              ^
Main.java:33: error: illegal character: '\u3000'
??? result = 0;
^
Main.java:33: error: illegal character: '\u3000'
??? result = 0;
 ^
Main.java:33: error: illegal character: '\u3000'
??? result = 0;
  ^
Main.java:38: error: ';' expected
                    result = m
                              ^
6 errors
Language: C++

#include <bits/stdc++.h>
#include <iomanip>

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef long double LD;
typedef pair<LD, LD> PLDLD;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define ALL(a) a.begin(),a.end()

LL INF=1e15+7;

int main()
{
    int n,m;
    cin>>n>>m;
    vector<PLL> p(n),q(m);
    REP(i,n)
    {
        LL a,b;
        cin>>a>>b;
        p[i]=PLL(a,b);
    }
    REP(i,m)
    {
        LL a,b;
        cin>>a>>b;
        q[i]=PLL(a,b);
    }

    REP(i,n)
    {
        int ans=0;
        LL mdis=INF,dis;
        REP(j,m)
        {
            dis=abs(p[i].first-q[j].first) + abs(p[i].second - q[j].second);
            if(dis<mdis)
            {
                mdis=dis;
                ans=j;
            }
        }
        cout<<ans+1<<endl;

    }*/
}



Compiler output:
a.cc: In function 'int main()':
a.cc:52:7: error: expected primary-expression before '/' token
   52 |     }*/
      |       ^
a.cc:53:1: error: expected primary-expression before '}' token
   53 | }
      | ^
Language: C++

#include<stdio.h>
#include<math.h>
int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	double a[50];
	double b[50];
	double c[50];
	double d[50];
	double h = pow(10, 8),i,g;
	for (int k = 0; k < n; k++) {
		scanf_s("%lf%lf", &a[k], &b[k]);
	}
	for (int k = 0; k < m; k++) {
		scanf_s("%lf%lf", &c[k], &d[k]);
	}
	for (int e= 0; e < n; e++) {
		for (int f = 0; f < m; f++) {
			g = sqrt(pow((a[e] - c[f]), 2) - pow(b[e] - d[f], 2));
			if (h > g) {
				h = g;
				i = f + 1;
			}
		}
		printf("%f\n", i);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   12 |                 scanf_s("%lf%lf", &a[k], &b[k]);
      |                 ^~~~~~~
      |                 scanf
a.cc:15:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   15 |                 scanf_s("%lf%lf", &c[k], &d[k]);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include<stdio.h>
#include<math.h>
int main() {
	int n, m;
	scanf_s("%d%d", &n, &m);
	double a[50];
	double b[50];
	double c[50];
	double d[50];
	double h = pow(10, 8),i,g;
	for (int k = 0; k < n; k++) {
		scanf_s("%lf%lf", &a[k], &b[k]);
	}
	for (int k = 0; k < m; k++) {
		scanf_s("%lf%lf", &c[k], &d[k]);
	}
	for (int e= 0; e < n; e++) {
		for (int f = 0; f < m; f++) {
			g = sqrt(pow((a[e] - c[f]), 2) - pow(b[e] - d[f], 2));
			if (h > g) {
				h = g;
				i = f + 1;
			}
		}
		printf("%f\n", i);
	}
	return 0;
}

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

#include<stdio.h>
#include<math.h>
int main() {
	int n, m;
	scanf_s("%d%d", &n, &m);
	double a[50];
	double b[50];
	double c[50];
	double d[50];
	double h = pow(10, 8),i,g;
	for (int k = 0; k < n; k++) {
		scanf_s("%lf%lf", &a[k], &b[k]);
	}
	for (int k = 0; k < m; k++) {
		scanf_s("%lf%lf", &c[k], &d[k]);
	}
	for (int e= 0; e < n; e++) {
		for (int f = 0; f < m; f++) {
			g = sqrt(pow((a[e] - c[f]), 2) - pow(b[e] - d[f], 2));
			if (h > g) {
				h = g;
				i = f + 1;
			}
		}
		printf("%f\n", i);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d%d", &n, &m);
      |         ^~~~~~~
      |         scanf
Language: Java

public class ABC057b {
    
    static int[] measureDistance(int x,int y,int[] arrx, int[] arry){
        int[] arrDistance = new int[arrx.length];
         for(int i = 0; i < arrx.length; i++) {
            int dx = x - arrx[i];
            int dy = y - arry[i];
            if(dx < 0){
                dx = -1 * dx;
            }
            if(dy < 0){
                dy = -1 * dy;
            }
            arrDistance[i] = dx + dy;
        }
         return arrDistance;
    }
    static int indexOf(int[] a){
        int min = a[0];
        for(int i = 1; i < a.length; i++){
            if(a[i] < min) min = a[i];
        }
        
        int index = 0;
        
        for(int i = 0; i < a.length; i++) {
            if(a[i] == min){
                index = i;
                i = a.length;
            }
        }
        return index;
    } 
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt(); //Number of Students
        int M = sc.nextInt(); //Number of checkpoint
        
        int[] arrStudentsX = new int[N];
        int[] arrStudentsY = new int[N];
        for(int i = 0; i < N; i++) {
            arrStudentsX[i] = sc.nextInt();
            arrStudentsY[i] = sc.nextInt();
        }
        
        int[] arrCheckpointX = new int[M];
        int[] arrCheckpointY = new int[M];
        for(int i = 0; i < M; i++) {
            arrCheckpointX[i] = sc.nextInt();
            arrCheckpointY[i] = sc.nextInt();
        }
        
        int[] result = new int[N];
        for(int i = 0; i < N; i++){
            int x = arrStudentsX[i];
            int y = arrStudentsY[i];
            int[] arr = measureDistance(x,y,arrCheckpointX,arrCheckpointY);
            result[i] = indexOf(arr) + 1;
        }
        
        for(int i = 0; i < N; i++){
            System.out.println(result[i]);
        }
        
    }
    
}

Compiler output:
Main.java:1: error: class ABC057b is public, should be declared in a file named ABC057b.java
public class ABC057b {
       ^
Main.java:36: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class ABC057b
Main.java:36: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class ABC057b
3 errors
Language: C++

#pragma warning(disable:4996)
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iostream>
#include<time.h>
#include<map>
#include<set>
#include<sstream>
#include<cassert>
using namespace std;
const int INF = 0x3f3f3f3f;

int p1()
{
    int a,b;
    cin >> a >> b;
    return (a+b+24)%24;
}

void p2()
{
    int m,n;
    cin >> m >> n;
    vector<int> study;
    while(m){
        int a1,b1;
        cin >> a1 >> b1;
        study.push_back(a1);
        study.push_back(b1);
        m--;
    }
    vector<int> point;
    while(n) {
        int c1,d1;
        cin >> c1 >>d1;
        point.push_back(c1);
        point.push_back(d1);
        n--;
    }
    int dist2 = 0;
    int ma = INT_MAX;
    int x,y;
    for(int i =0; i<study.size(); i=i+2)
    {
        for(int j=0, index = 0; j<point.size(); j=j+2, ++index)
        {
            dist2 = abs(study[i]-point[j])
                + abs(study[i+1]-point[j+1]);
            if(dist2 < ma)
            {
                ma = dist2;
                x = i+1, y = index+1;
            }
        }
        cout <<y<<endl;
        dist2 = 0;
        ma = INT_MAX;
    }
}

int main()
{
    p2();
    return 0;
}



Compiler output:
a.cc: In function 'void p2()':
a.cc:45:14: error: 'INT_MAX' was not declared in this scope
   45 |     int ma = INT_MAX;
      |              ^~~~~~~
a.cc:14:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   13 | #include<cassert>
  +++ |+#include <climits>
   14 | using namespace std;
Language: C++

#include<cstdio>
#include<conio.h>
#include<math.h>
#include<algorithm>
using namespace std;
int a[100],b[100],x[100],y[100],lon[100],ans[100];

int main(){
    int n,m,i,j;
    scanf("%d %d",&n,&m);
    for(i=0;i<n;i++){
        scanf("%d %d",&a[i],&b[i]);             
    }
    for(i=0;i<m;i++){
        scanf("%d %d",&x[i],&y[i]);             
    }
    for(i=0;i<n;i++){
        for(j=0;j<m;j++){
             if(lon[i]>abs(a[i]-x[j])+abs(b[i]-y[j])){
                  ans[i]=j;
                  lon[i]=abs(a[i]-x[j])+abs(b[i]-y[j]);                               
             }
             if(j==0){
                  ans[i]=j;
                  lon[i]=abs(a[i]-x[j])+abs(b[i]-y[j]);  
             }
        }             
    }
    for(i=0;i<n;i++){
        printf("%d\n",ans[i]+1);  
    }
    return 0;
}


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

#include <iostream>
#include <vector>



using namespace std;








int main() {

//
//
//    int A;
//    cin >> A;
////    A = 9;
//
//    int B;
//    cin >> B;
////    B = 12;
//
//
//    cout << (A + B) % 24;



    // ------------------------------------------------------------------------------------------



//    freopen("/Users/balazskemenes/Documents/temp/practise/src/problems/input.txt","r",stdin);


    int studentCount;
    cin >> studentCount;

    int checkpointCount;
    cin >> checkpointCount;




    vector<int> studentsX;
    vector<int> studentsY;

    vector<int> checkpointsX;
    vector<int> checkpointsY;


    for(int i = 0; i < studentCount; ++i) {


        int sX;
        int sY;

        cin >> sX;
        cin >> sY;


        studentsX.emplace_back(sX);
        studentsY.emplace_back(sY);

    }





    for(int i = 0; i < checkpointCount; ++i) {


        int cX;
        int cY;

        cin >> cX;
        cin >> cY;


        checkpointsX.emplace_back(cX);
        checkpointsY.emplace_back(cY);

    }


    for(int i = 0; i < studentCount; ++i) {


        int sX = studentsX[i];
        int sY = studentsY[i];


        double minDistance = INT_MAX;

        int checkpointId = 0;

        for(int j = 0; j < checkpointCount; ++j) {


            int cX = checkpointsX[j];
            int cY = checkpointsY[j];


            double currentDistance = abs(sX - cX) + abs(sY - cY);


            if(currentDistance < minDistance) {


                minDistance = currentDistance;


                checkpointId = j + 1;

            }




        }



        cout << checkpointId << endl;


    }







    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:97:30: error: 'INT_MAX' was not declared in this scope
   97 |         double minDistance = INT_MAX;
      |                              ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 |
Language: C++

#include <string>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>

using namespace std;

typedef pair<int, int> coord;

int distance(int x1, int y1, int x2, int y2)
{
  return abs(x1 - x2) + abs(y1 - y2);
}

int main()
{
  int N, M;
  cin >> N >> M;
  vector<coord> students(N);
  vector<coord> checkpoints(M);
  vector<coord> answers(N);
  for (int i = 0; i < N; ++i) cin >> students[i].first >> students[i].second;
  for (int i = 1; i <= M; ++i) {
    int x, y;
    cin >> x >> y;
    for (int j = 0; j < N; ++j) {
      int dist = distance(x, y, students[j].first, students[j].second);
      if (answers[j].first == 0 or dist < answers[j].second) {
        answers[j].first = i;
        answers[j].second = dist;
      }
    }
  }
  for (const auto answer: answers) cout << answer.first << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'cin' was not declared in this scope
   19 |   cin >> N >> M;
      |   ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include <algorithm>
  +++ |+#include <iostream>
    6 | 
a.cc:35:36: error: 'cout' was not declared in this scope
   35 |   for (const auto answer: answers) cout << answer.first << endl;
      |                                    ^~~~
a.cc:35:36: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:60: error: 'endl' was not declared in this scope
   35 |   for (const auto answer: answers) cout << answer.first << endl;
      |                                                            ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include <algorithm>
  +++ |+#include <ostream>
    6 |
Language: C++

#include <bits/stdc++.h>

using namespace std;

int a[100], b[100], c[100], d[100];
int n, m;

int main(){

	scanf("%d %d", &n, &m);

	for(int i = 0; i < n; i++)
		scanf("%d %d", a+i, b+i);

	for(int i = 0; i < m; i++)
		scanf("%d %d", c+i, d+i);

	for(int i = 0; i < n; i++){
		int ans = 0, mn = 1000000000;
		for(int j = 0; j < m; j++){
			int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
			if(d < mn){
				mn = d;
				ans = j;
			}
		}

		printf("%d\n", ans+1);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:64: error: invalid types 'int[int]' for array subscript
   21 |                         int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      |                                                                ^
Language: C++

#include <set>
#include <map>
#include <queue>
#include <deque>
#include <cstdio>
#include <string>
#include <vector>
#include <math.h>
#include <time.h>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <cstring>
#include <stdio.h>
#include <iomanip>
#include <conio.h>
#include <iostream>
#include <algorithm>
#include <windows.h>
#define ll long long
#define StopProgram() exit(0)
#define Max(a,b) (b<a ? a : b)
#define Min(a,b) (a<b ? a : b)
#define Abs(x) ((x) > 0 ? (x) : -(x))
#define Fast() ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
using namespace std;
int n, m, a[55], b[55], c[55], d[55];
int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i++) scanf("%d%d", &a[i], &b[i]);
	for (int i = 1; i <= m; i++) scanf("%d%d", &c[i], &d[i]);
	for (int i = 1; i <= n; i++) {
		int e = -1;
		for (int j = 1; j <= m; j++) if (e == -1 || abs(a[i]-c[j])+abs(b[i]-d[j])<abs(a[i]-c[e])+abs(b[i]-d[e])) e=j;
		printf("%d\n", e);
	}
	return 0;
}

Compiler output:
a.cc:16:10: fatal error: conio.h: No such file or directory
   16 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
#include <cstdlib>

int main(void) {
  int n,  m;
  scanf("%i %i", &n, &m);
  
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    scanf("%i %i", &a[i], &b[i]);
  }
  
  int c[m], b[m];
  for (int i = 0; i < m; i++) {
    scanf("%i %i", &c[i], &d[i]);
  }
  
  for (int i = 0; i < n; i++) {
    int best = 1 << 30, idx = -1;
    for (int j = 0; j < m; j++) {
      int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      if (d < best) {
        best = d;
        idx = j;
      }
    }
    
    printf("%i\n", j + 1);
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: conflicting declaration 'int b [m]'
   13 |   int c[m], b[m];
      |             ^
a.cc:8:13: note: previous declaration as 'int b [n]'
    8 |   int a[n], b[n];
      |             ^
a.cc:15:28: error: 'd' was not declared in this scope
   15 |     scanf("%i %i", &c[i], &d[i]);
      |                            ^
a.cc:21:46: error: invalid types 'int[int]' for array subscript
   21 |       int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      |                                              ^
a.cc:28:20: error: 'j' was not declared in this scope
   28 |     printf("%i\n", j + 1);
      |                    ^
Language: C++

#include <iostream>
#include <cmath>
#define INF 1e+9
using namespace std;

int main(){
	int n,m,a[50],b[50],c[50],d[50];
	cin >> n >> m;
	for(int i = 0;i < n;i++){
		cin >> a[i] >> b[i];
	}
	for(int i = 0;i < m;i++) cin >> c[i] >> d[i];
	for(int i = 0;i < n;i++){
		int mi = INF,mii;
		for(int j = 0;j < m;j++){
			int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
			if(mi > d){
				mi = d;
				mii = j + 1;
			}
		}
		cout << mii << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:64: error: invalid types 'int[int]' for array subscript
   16 |                         int d = abs(a[i] - c[j]) + abs(b[i] - d[j]);
      |                                                                ^
Language: C++

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

const int64_t MOD = 1000000007;
typedef int64_t ll;
typedef uint64_t ull;

#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}

// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
  long i,sq;
  if(a%2==0){ //偶数の場合
    factors.push_back(2);
    primeFactorization(a/2,factors); //2で割った値で再帰
    return;
  }
  sq = sqrt(a);
  for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
	if(a%i==0){
	  factors.push_back(i);
      primeFactorization(a/i,factors); //割れた値で再帰
      return;
	}
  }
  //偶数でも3以上√a以下の奇数の場合でも割り切れない場合
  if(a!=1){ //aが1でないなら、a自身は素数
    factors.push_back(a);
  }
}

// フェルマーの小定理
// mod. m での a の逆元 a^{-1} を計算する
// (a/b)%m = a*movinv(b,m)%m  
int64_t modinv(int64_t a, int64_t m) {
    int64_t b = m, u = 1, v = 0;
    while (b) {
        int64_t t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

/* 
  //エラトステネスのふるい
  int maxNum = 100000;
  char isNotPrime[maxNum+1] = {};
  isNotPrime[0]=isNotPrime[1]=1;
  for(int i=2;i<maxNum;i++){
    if(isNotPrime[i]==1) continue;
    int num = i+i;
    while(num<=maxNum){
      isNotPrime[num]=1;
      num += i;
    }
  }
*/
// 円周率
// M_PI

// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;

// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;

// 降順ソート vector<int> v;
// sort(v.begin(),v.end(),greater<int>());

signed main() {
  ull n;
  cin >> n;
  
  ull a = 0;
  for(ull i=sqrt(n);i>=1;i--){
    if(n%i==0){
      a = i;
      break;
    }
  }
  if(a==1){
    a = n;z
  }
  //cout << a << ":" << n/a << endl;
  int count = 0;
  while(a>0){
    a /= 10;
    count++;
  }
  
  cout << count << endl;
  return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:124:11: error: 'z' was not declared in this scope
  124 |     a = n;z
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int Decimal(int N){
  int num=0;
  while(N!=0){
    N=N/10;
    num++;
  }
  
  return num;
}

    
int main(){
  int N; //Nの数
  long B=1; //AとBの数の入れ物を用意
  int ans=12;
  /////入力部/////
  cin >> N;
  
  int ans=Decimal(N); //1の時の値
  
  for (long A=2;A*A<=N;A++){
    if(N%i == 0){
      B /= i;
      if(ans >=Decimal(B))ans = Decimal(B);
    }
  }
  cout<<ans<<endl;
}

        
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: redeclaration of 'int ans'
   21 |   int ans=Decimal(N); //1の時の値
      |       ^~~
a.cc:17:7: note: 'int ans' previously declared here
   17 |   int ans=12;
      |       ^~~
a.cc:24:10: error: 'i' was not declared in this scope
   24 |     if(N%i == 0){
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int Decimal(int N){
  int num=0;
  while(N!=0){
    N=N/10;
    num++;
  }
  
  return num;
}

    
int main(){
  int N; //Nの数
  int A=1,B=1,C=0; //AとBの数の入れ物を用意
  int ans=12;
  /////入力部/////
  cin >> N;
  
  int ans=Decimal(N); //1の時の値
  
  for (long i=2;i^2<=N;i++){
    if(N%i == 0){
      B /= i;
      if(ans >=Decimal(B))ans = Decimal(B);
    }
  }
  cout<<ans<<endl;
}

        
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: redeclaration of 'int ans'
   21 |   int ans=Decimal(N); //1の時の値
      |       ^~~
a.cc:17:7: note: 'int ans' previously declared here
   17 |   int ans=12;
      |       ^~~
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
const int mod = 1000000007;
const double PI = acos(-1);

int main()
{
	ll n;
	cin >> n;
	ll ans = INT_MAX;
	for (ll a = 1; a <= sqrt(n); a++) {
		ll b = n / a;
		ll f = max(to_string(a).size(), to_string(b).size());
		ans = min(ans, f);
	}
	cout << ans << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint;
const int mod = 1000000007;
const double PI = acos(-1);

int main()
{
	ll n;
	cin >> n;
	int ans = INT_MAX;
	for (ll a = 1; a <= sqrt(n); a++) {
		ll b = n / a;
		int f = max(to_string(a).size(), to_string(b).size());
		ans = min(ans, f);
	}
	cout << ans << endl;
}


Compiler output:
a.cc:3:17: error: 'atcoder' is not a namespace-name
    3 | using namespace atcoder;
      |                 ^~~~~~~
a.cc:5:14: error: 'modint' does not name a type; did you mean 'mode_t'?
    5 | using mint = modint;
      |              ^~~~~~
      |              mode_t
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint;
const int mod = 1000000007;
const double PI = acos(-1);

int main()
{
	ll n;
	cin >> n;
	int ans = INT_MAX;
	for (ll a = 1; a <= sqrt(n); a++) {
		ll b = n / a;
		int f = max(to_string(a).size(), to_string(b).size());
		ans = min(ans, f);
	}
	cout << ans << endl;
}


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



import java.util.*;

public class Main2 {
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		long right;
		long left;
		
		long min=1000000000;
		long max;
		for(long i=1;i<=n/2;i++)
		{
			if(n%i==0)
			{
				right=n/i;
				if(right>i) max=right;
				else max=i;
				min=Math.min(min,(long)Math.log10(max)+1);
				
			}
		}
		System.out.println(min);
		
	}

}


Compiler output:
Main.java:5: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
ll keta(ll n){
  ll i,ans=0;
  while(n>0){
    n/=10;
    ans++;
  }
  return ans;
}
int main(){
  ll n;
  cin >> n;
  ll i,cp=n,ans=1000;
  for(i=1;i*i<=n;i++){
    if(cp%i==0){
      ll q=cp/i;
      ll a=keta(q);
      ll b=keta(i);
      ll maxi=max(a,b);
      ans=min(ans,maxi);
    }
  }
  cout << ans;
}
      
  
}


Compiler output:
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

int digit(long long int a)
{	
	int  ans = 0;
	while(a > 0){
		a/=10;
		ans++;
	}

	return ans;
}


int main() {
	int i;
	int count = 1;
	long long int N, A = 1, B;
	int ans = 15;

	cin >> N;

	while ((double)A =< sqrt((double)N))
	{
		if (N % A == 0)
		{
			B = N/A;
			count = max(digit(A),digit(B));
			if (ans > count)
			{
				ans = count;
			}
			
		}
		A++;
	}

	
	cout << ans <<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:27: error: expected primary-expression before '<' token
   27 |         while ((double)A =< sqrt((double)N))
      |                           ^
Language: C++

#include <bits/stdc++.h>
using ll=long long;
int cnt_digits(ll N){
 int digits=0;

 while(N>0){
 N/=10;
 digits++;
 }

 return digits;
 }

 int main(void){
 ll N;
 cin >> N;

 int ans=cnt_digits(N); // 1*N=N max(cnt_digits(1),cnt_digits(N))=cnt_digits(N)

 for(ll A=1LL;A*A<=N;++A){
 if(N%A!=0) continue;
 const ll B=N/A;

 const int cur=max(cnt_digits(A),cnt_digits(B));

 if(ans>cur){
 ans=cur;
 }
 }

 cout << ans << endl;
 return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   16 |  cin >> N;
      |  ^~~
      |  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:24:16: error: 'max' was not declared in this scope; did you mean 'std::max'?
   24 |  const int cur=max(cnt_digits(A),cnt_digits(B));
      |                ^~~
      |                std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:31:2: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |  cout << ans << 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:31:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   31 |  cout << ans << 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)
      |     ^~~~
Language: C++

using ll=long long;
int cnt_digits(ll N){
 int digits=0;

 while(N>0){
 N/=10;
 digits++;
 }

 return digits;
 }

 int main(void){
 ll N;
 cin >> N;

 int ans=cnt_digits(N); // 1*N=N max(cnt_digits(1),cnt_digits(N))=cnt_digits(N)

 for(ll A=1LL;A*A<=N;++A){
 if(N%A!=0) continue;
 const ll B=N/A;

 const int cur=max(cnt_digits(A),cnt_digits(B));

 if(ans>cur){
 ans=cur;
 }
 }

 cout << ans << endl;
 return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:2: error: 'cin' was not declared in this scope
   15 |  cin >> N;
      |  ^~~
a.cc:23:16: error: 'max' was not declared in this scope
   23 |  const int cur=max(cnt_digits(A),cnt_digits(B));
      |                ^~~
a.cc:30:2: error: 'cout' was not declared in this scope
   30 |  cout << ans << endl;
      |  ^~~~
a.cc:30:17: error: 'endl' was not declared in this scope
   30 |  cout << ans << endl;
      |                 ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main(){
  	long long X;
  	cin >> X;
  	int root=sqrt(X);
  	int ans = log10(X);
  	for(int i=0;i<root;i++){
      	if(X%i==0) ans = min(max(log10(X/i), log10(i)), ans);
    }
  	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: no matching function for call to 'min(const double&, int&)'
   13 |         if(X%i==0) ans = min(max(log10(X/i), log10(i)), ans);
      |                          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:13:29: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'int')
   13 |         if(X%i==0) ans = min(max(log10(X/i), log10(i)), ans);
      |                          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:13:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   13 |         if(X%i==0) ans = min(max(log10(X/i), log10(i)), ans);
      |                          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main(){
  	long long X;
  	cin >> X;
  	int root=sqrt(X);
  	ans = log10(X);
  	for(int i=0;i<root;i++){
      	if(X%i==0) ans = min(max(log10(X/i), log10(i)), ans);
    }
  	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |         ans = log10(X);
      |         ^~~
      |         abs
Language: C++

//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<set>
#include<map>

/*
#include<boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/rational.hpp>
namespace mp = boost::multiprecision;
using Real = mp::number<mp::cpp_dec_float<1024>>;
using Bint = mp::cpp_int;
*/

using namespace std;

#define int long long
#define REP(i,s,e) for((i)=(s);(i)<(e);(i)++)
#define RREP(i,s,e) for((i)=((s)-1);(i)>=(e);(i)--)
#define FOR(i,n) for((i)=(0);(i)<(n);(i)++)
#define RFOR(i,n) for((i)=((n)-1);(i)>=(0);(i)--)
#define MOD 1000000007


signed main(){
    int N;
    cin>>N;

    int ans=LLONG_MAX;
    for(int i=1;i<sqrt(N)+1;i++){
        if(N%i==0){
            int n1=N/i;
            int n2=i;
            int keta1=0;
            int keta2=0;
            while(n1!=0){
                keta1++;
                n1/=10;
            }
            while(n2!=0){
                keta2++;
                n2/=10;
            }
            ans=min(ans,max(keta1,keta2));
        }
    }

    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:13: error: 'LLONG_MAX' was not declared in this scope
   33 |     int ans=LLONG_MAX;
      |             ^~~~~~~~~
a.cc:9:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include<map>
  +++ |+#include <climits>
    9 |
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  long n;
  cin >> n;
  string s;
  long a;
  for(long i = 10000;i >= 1;i--){
    if(n % i == 0){
      a = max(i,n/i)
      s = to_string(a);
      cout << s.size() << endl;
      break;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected ';' before 's'
   11 |       a = max(i,n/i)
      |                     ^
      |                     ;
   12 |       s = to_string(a);
      |       ~
Language: C++

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

int main(){
  long n;
  cin >> n;
  string s;
  long a;
  for(int i = 10000;i >= 1;i--){
    if(n % i == 0){
      a = max(i,n/i)
      s = to_string(a);
      cout << s.size() << endl;
      break;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: no matching function for call to 'max(int&, long int)'
   11 |       a = max(i,n/i)
      |           ~~~^~~~~~~
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:11:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   11 |       a = max(i,n/i)
      |           ~~~^~~~~~~
/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:11:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |       a = max(i,n/i)
      |           ~~~^~~~~~~
Language: C++

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

# define ll long long 
# define VI vector<int>
# define VLL vector<ll>
# define PII pair<int,int> 
#define mp make_pair
#define pb push_back
# define PI acos(-1)
# define double long double
const int MxN = 10005 ; 
# define FOR(i,a,b) for(int i = a ; i < b ; ++i)
# define RFOR(i,a,b) for(int i = a ; i >= b ; --i)

/* VARIABLES */
ll n ; 
/* END OF VARIABLES */

int dig(ll n) {
	int ans = 0 ;
	while(n) {
		n = n / 10 ; 
		ans++;
	}
	return ans ; 
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL) ; 
	int ans = 1e9 ; 
	cin >> n ; 
	for(ll i = 1 ; i <= sqrt(n) , i++) {
		if(n%i == 0) 
			ans = min(ans,dig(max(i,n/i))) ; 
	} 
	cout << ans ; 
	return 0 ; 
}



Compiler output:
a.cc: In function 'int main()':
a.cc:34:42: error: expected ';' before ')' token
   34 |         for(ll i = 1 ; i <= sqrt(n) , i++) {
      |                                          ^
      |                                          ;
Language: C++

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

# define ll long long 
# define VI vector<int>
# define VLL vector<ll>
# define PII pair<int,int> 
#define mp make_pair
#define pb push_back
# define PI acos(-1)
# define double long double
const int MxN = 10005 ; 
# define FOR(i,a,b) for(int i = a ; i < b ; ++i)
# define RFOR(i,a,b) for(int i = a ; i >= b ; --i)

/* VARIABLES */
ll n ; 
/* END OF VARIABLES */

int dig(ll n) {
	int ans = 0 ;
	while(n) {
		n = n / 10 ; 
		ans++;
	}
	return ans ; 
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL) ; 
	int ans = 1e9 ; 
	cin >> n ; 
	FOR(i,1,sqrt(n)+1) {
		if(n%i == 0) 
			ans = min(ans,dig(max(i,n/i))) ; 
	} 
	cout << ans ; 
	return 0 ; 
}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:46: error: no matching function for call to 'max(int&, long long int)'
   36 |                         ans = min(ans,dig(max(i,n/i))) ;
      |                                           ~~~^~~~~~~
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:36:46: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   36 |                         ans = min(ans,dig(max(i,n/i))) ;
      |                                           ~~~^~~~~~~
/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:36:46: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   36 |                         ans = min(ans,dig(max(i,n/i))) ;
      |                                           ~~~^~~~~~~
Language: C++



#include <bits/stdc++.h>
#include <string.h>
#include <vector>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15
#define MOD 1000000007

 int main(){

 long long n,ans=0;
 cin>>n;


 for(int i=1;i<= sqrt(n);i++){

   if(n%i == 0){
     if(ans == 0)
        ans = max(f(i),f(n/i));
     else
        ans = min(max(f(i),f(n/i)),ans);
   }
 }

 cout<<ans<<endl;

  return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:30:19: error: 'f' was not declared in this scope
   30 |         ans = max(f(i),f(n/i));
      |                   ^
a.cc:32:23: error: 'f' was not declared in this scope
   32 |         ans = min(max(f(i),f(n/i)),ans);
      |                       ^