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

Main()
{    
#include <math.h>
#include <stdio.h>
    int int_n;
    scanf("%d",&int_n);
    double sqrt(
        double int_n
    );
    int i;
    i = s;
    while(i >= 1)
    {
          if (int_n % i == 0){
            int j = int_n/i;
            printf(math.floor((i - 1) + (j - 1)))
            break;
          }
              i = i - 1;
    }
}


Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | Main()
      | ^~~~
main.c: In function 'Main':
main.c:11:9: error: 's' undeclared (first use in this function)
   11 |     i = s;
      |         ^
main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:20: error: 'math' undeclared (first use in this function)
   16 |             printf(math.floor((i - 1) + (j - 1)))
      |                    ^~~~
main.c:16:50: error: expected ';' before 'break'
   16 |             printf(math.floor((i - 1) + (j - 1)))
      |                                                  ^
      |                                                  ;
   17 |             break;
      |             ~~~~~
Language: C

Main()
{    
    int int_n;
    int_n = scanf("%d");
    double s;
    s =  sqrt(int_n);
    int i;
    i = s;
    while(i >= 1)
    {
          if (int_n % i == 0){
            int j = int_n/i;
            printf(math.floor((i - 1) + (j - 1)))
            break;
          }
              i = i - 1;
    }
}


Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | Main()
      | ^~~~
main.c: In function 'Main':
main.c:4:13: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |     int_n = scanf("%d");
      |             ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | Main()
main.c:4:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |     int_n = scanf("%d");
      |             ^~~~~
main.c:4:13: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:10: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
    6 |     s =  sqrt(int_n);
      |          ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
  +++ |+#include <math.h>
    1 | Main()
main.c:6:10: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
    6 |     s =  sqrt(int_n);
      |          ^~~~
main.c:6:10: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c:13:13: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |             printf(math.floor((i - 1) + (j - 1)))
      |             ^~~~~~
main.c:13:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:13: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:20: error: 'math' undeclared (first use in this function)
   13 |             printf(math.floor((i - 1) + (j - 1)))
      |                    ^~~~
main.c:13:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:50: error: expected ';' before 'break'
   13 |             printf(math.floor((i - 1) + (j - 1)))
      |                                                  ^
      |                                                  ;
   14 |             break;
      |             ~~~~~
Language: C++

#include <iostream>
#include<vector>
#include<algorithm>
#include <queue>
#include <string>
#include <set>
#include <bitset>

using namespace std;
#define ff(ii,nn,mm) for(int ii=nn;ii<mm;ii++)
#define i64 int64_t
#define tos(x) to_string(x)

int main() {
	i64 n;
	cin >> n;
	int a = 0, b = 0;
	ff(i, 1, sqrt(n) + 1) {
		if (n % i == 0) {
			a = i;
			b = n / i;
		}
	}
	cout << a + b - 2 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: 'sqrt' was not declared in this scope
   18 |         ff(i, 1, sqrt(n) + 1) {
      |                  ^~~~
a.cc:10:39: note: in definition of macro 'ff'
   10 | #define ff(ii,nn,mm) for(int ii=nn;ii<mm;ii++)
      |                                       ^~
Language: C++

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

int main() {
  long long n; cin >> n;
  long long ans = 1e13;
  for(int i = 1; i * i < n; ++i) {
    if(n % i == 0) {
      ans = min(ans, o + n / i);
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'o' was not declared in this scope
    9 |       ans = min(ans, o + n / i);
      |                      ^
Language: C++

double N;
    int i;
    int division1;
    int cal;
    int ans;
    scanf("%lf",&N);
    ans = N-1;
    for(i=1;i<=N/2;i++){
        division1 = N/i;
        if(N == division1*i){
            cal = (division1-0.1)+(i-1);
            if(ans>=cal){
                ans = cal;
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}


Compiler output:
a.cc:6:10: error: expected constructor, destructor, or type conversion before '(' token
    6 |     scanf("%lf",&N);
      |          ^
a.cc:7:5: error: 'ans' does not name a type
    7 |     ans = N-1;
      |     ^~~
a.cc:8:5: error: expected unqualified-id before 'for'
    8 |     for(i=1;i<=N/2;i++){
      |     ^~~
a.cc:8:13: error: 'i' does not name a type
    8 |     for(i=1;i<=N/2;i++){
      |             ^
a.cc:8:20: error: 'i' does not name a type
    8 |     for(i=1;i<=N/2;i++){
      |                    ^
a.cc:17:11: error: expected constructor, destructor, or type conversion before '(' token
   17 |     printf("%d\n",ans);
      |           ^
a.cc:18:5: error: expected unqualified-id before 'return'
   18 |     return 0;
      |     ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++


#include <cmath>
#include <iostream>

int main()
{
  long long N;
  std::cin >> N;
  long long M = static_cast<__int64>(sqrt(static_cast<double>(N)));
  long long T = 1 + N;
  for (long long i = 2; i <= M; ++i)
    if (0 == N%i)
      if (i + N/i < T)
        T = i + N/i;
  std::cout << T - 2 << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: '__int64' does not name a type; did you mean '__int64_t'?
    9 |   long long M = static_cast<__int64>(sqrt(static_cast<double>(N)));
      |                             ^~~~~~~
      |                             __int64_t
Language: C++


#include <cmath>
#include <iostream>

int main()
{
  __int64 N;
  std::cin >> N;
  __int64 M = static_cast<__int64>(sqrt(static_cast<double>(N)));
  __int64 T = 1 + N;
  for (__int64 i = 2; i <= M; ++i)
    if (0 == N%i)
      if (i + N/i < T)
        T = i + N/i;
  std::cout << T - 2 << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    7 |   __int64 N;
      |   ^~~~~~~
      |   __ynf64
a.cc:8:15: error: 'N' was not declared in this scope
    8 |   std::cin >> N;
      |               ^
a.cc:9:10: error: expected ';' before 'M'
    9 |   __int64 M = static_cast<__int64>(sqrt(static_cast<double>(N)));
      |          ^~
      |          ;
a.cc:10:10: error: expected ';' before 'T'
   10 |   __int64 T = 1 + N;
      |          ^~
      |          ;
a.cc:11:15: error: expected ';' before 'i'
   11 |   for (__int64 i = 2; i <= M; ++i)
      |               ^~
      |               ;
a.cc:11:23: error: 'i' was not declared in this scope
   11 |   for (__int64 i = 2; i <= M; ++i)
      |                       ^
a.cc:11:28: error: 'M' was not declared in this scope
   11 |   for (__int64 i = 2; i <= M; ++i)
      |                            ^
a.cc:13:21: error: 'T' was not declared in this scope
   13 |       if (i + N/i < T)
      |                     ^
a.cc:15:16: error: 'T' was not declared in this scope
   15 |   std::cout << T - 2 << std::endl;
      |                ^
Language: C++

#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
int main(){
  double N;
  cin >> N;
  
  double num = sqrt(N);
  int num2;
  int num3;
  
  for(double i = num;i > 0.0;--i){
    if(N % i == 0.0){
      num2 = N / i;
      num3 = i;
    }
    if(N % i == 0.0 && N / i > i){
      break;
    }
  }
  
  int num4 = num2 - 1;
  int num5 = num3 - 1;
  
  cout << num4 + num5 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   13 |     if(N % i == 0.0){
      |        ~ ^ ~
      |        |   |
      |        |   double
      |        double
a.cc:17:10: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   17 |     if(N % i == 0.0 && N / i > i){
      |        ~ ^ ~
      |        |   |
      |        |   double
      |        double
Language: C++

#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
int main(){
  double N;
  cin >> N;
  
  double num = sqrt(N);
  int num2;
  int num3;
  
  for(double i = num;i > 0.0;--i){
    if(N % i == 0){
      num2 = N / i;
      num3 = i;
    }
    if(N % i == 0 && N / i > i){
      break;
    }
  }
  
  int num4 = num2 - 1;
  int num5 = num3 - 1;
  
  cout << num4 + num5 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   13 |     if(N % i == 0){
      |        ~ ^ ~
      |        |   |
      |        |   double
      |        double
a.cc:17:10: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   17 |     if(N % i == 0 && N / i > i){
      |        ~ ^ ~
      |        |   |
      |        |   double
      |        double
Language: C++

#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
int main(){
  double N;
  cin >> N;
  
  double num = sqrt(N);
  int num2;
  int num3;
  
  for(int i = num;i > 0;--i){
    if(N % i == 0){
      num2 = N / i;
      num3 = i;
    }
    if(N % i == 0 && N / i > i){
      break;
    }
  }
  
  int num4 = num2 - 1;
  int num5 = num3 - 1;
  
  cout << num4 + num5 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   13 |     if(N % i == 0){
      |        ~ ^ ~
      |        |   |
      |        |   int
      |        double
a.cc:17:10: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   17 |     if(N % i == 0 && N / i > i){
      |        ~ ^ ~
      |        |   |
      |        |   int
      |        double
Language: Java

import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    double s = Math.sqrt((double)N);
    int n = (int)s;
    
    int x = 1;
    int y = 1;
    int afterX = 0;
    int afterY = 0;
    
    for(int i=n; i>0; i--){
      if(N % i == 0){
        afterX = i;
        break;
      }
    }
    
    if(afterX != 0){
      afterY = N / afterX;
      System.out.println((afterX-x) + (afterY-y));
    }else{
      System.out.println(N - 1);
    }
  }
}


Compiler output:
Main.java:23: error: incompatible types: possible lossy conversion from long to int
      afterY = N / afterX;
                 ^
1 error
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  int i=1;
  int j=1;
  int sum[N];
  int p=0;
  for(;i<=N;i++){
      for(;j<=N;j++){
        int sum[p]=i+j-2;
        p++;
      }
  }
  int answer=sum[0];
  for(int q=1;q<=N;q++){
       if(answer>sum[q]){
          answer=sum[q];
       }
  }
  cout<<answer;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: array must be initialized with a brace-enclosed initializer
   12 |         int sum[p]=i+j-2;
      |                    ~~~^~
Language: C++

#include<iostream>
using namespace std;
int main(){
int N;
  cin>>N;
int I[N];
int J[N];
int p=0;
int answer;
for(int i=1;i=<N;i++){
for(int j=1;j=<N;j++){
if(i*j==N){
  I[p]=i-1;
  J[p]=j-1;
  p++;
}
}
}
p=0;
int sum[N];
  for(;p=<N-1;p++){
    sum[p]=I[p]+J[p];
  }
p=1;
answer=sum[0];
for(;p=<N-1;p++){
    if(answer>sum[p]){
      answer=sum[p];
    }
}
  cout<<answer;
}
      




Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected primary-expression before '<' token
   10 | for(int i=1;i=<N;i++){
      |               ^
a.cc:11:15: error: expected primary-expression before '<' token
   11 | for(int j=1;j=<N;j++){
      |               ^
a.cc:21:10: error: expected primary-expression before '<' token
   21 |   for(;p=<N-1;p++){
      |          ^
a.cc:26:8: error: expected primary-expression before '<' token
   26 | for(;p=<N-1;p++){
      |        ^
Language: C++

#include <stdio.h>

typedef long long int lli;

int main() {
  lli n, akar, a;
  scanf("%lld", &n);
  akar = sqrt(n);
  for (lli i = akar; i > 0; i--)
    if (n % i == 0) {
      a = n / i;
      printf("%lld\n", i + a - 2);
      return 0;
    }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'sqrt' was not declared in this scope
    8 |   akar = sqrt(n);
      |          ^~~~
Language: C++

#include(bits/stdc++.h)
using namespace std;

int main(){
  long long n,b,ans;
  int a;
  cin >> n;
  for(a=0; a<pow(n,0.5); a++){
    b=n/a;
    if(a*b==n){
      ans=a+b-2;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include(bits/stdc++.h)
      |         ^
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include(bits/stdc++.h)
a.cc:8:14: error: 'pow' was not declared in this scope
    8 |   for(a=0; a<pow(n,0.5); a++){
      |              ^~~
a.cc:14:3: error: 'cout' was not declared in this scope
   14 |   cout << ans << endl;
      |   ^~~~
a.cc:14:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:18: error: 'endl' was not declared in this scope
   14 |   cout << ans << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include(bits/stdc++.h)
Language: C++

#include<bits/stdc++.h>
#define int long long int
using namespace std;
int32_t main(){
  int n,int a,int b;
  cin >> n;
  for(int i=sqrt(n);i>=1;i++){
  if(n%i==0){
  a=i;
  b=n/i;
    break;
  }
  }
  cout << a-1+b-1;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:2:13: error: expected unqualified-id before 'long'
    2 | #define int long long int
      |             ^~~~
a.cc:5:9: note: in expansion of macro 'int'
    5 |   int n,int a,int b;
      |         ^~~
a.cc:9:3: error: 'a' was not declared in this scope
    9 |   a=i;
      |   ^
a.cc:10:3: error: 'b' was not declared in this scope
   10 |   b=n/i;
      |   ^
a.cc:14:11: error: 'a' was not declared in this scope
   14 |   cout << a-1+b-1;
      |           ^
a.cc:14:15: error: 'b' was not declared in this scope
   14 |   cout << a-1+b-1;
      |               ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <regex>
#include <map>
#include <set>
#include <iomanip>

using namespace std;
using ll = long long;

int main() {
    ll N;
    cin >> N;
    
    ll ans = 10000あ000000001;
    for(ll i=sqrt(N);i>=1;i--){
        if(N%i == 0){
            ans = min(ans,N/i+i-2);
    }
    }
    cout << ans << endl;

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: unable to find numeric literal operator 'operator""\U00003042000000001'
   18 |     ll ans = 10000あ000000001;
      |              ^~~~~~~~~~~~~~~~
Language: C++

#include <stdio.h>

int main(){
  int N;
  int i;
  int x,y,x2,y2;
  scanf("%d", &N);
  x = 1;y = N;
  sum = x+y-2;
  for(i = 1; i <= N; i++){
    if(N%i == 0){
      x2 = i;y2 = N/i;
      if(x+y-2 > x2+y2-2){
        x = x2; y = y2;
      }
  }
   printf("%d",x+y-2);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'sum' was not declared in this scope
    9 |   sum = x+y-2;
      |   ^~~
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

int main(void) {
    int n;
    int min;
    // vector<int> vec;
    cin >> n;

    for(int i = 1; i <= n / 2; i++) {
        if (n % i == 0) {
            // vec.push_back(i - 1 + n / i - 1);
            min = i - 1 + n / i - 1
        }
    }

    // min = vec[0];
    // for (int i = 1; i < vec.size(); i++)
    //     if (vec[i] < min) min = vec[i];
    
    cout << min;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'min'?
    5 |     cin >> n;
      |     ^~~
      |     min
a.cc:10:36: error: expected ';' before '}' token
   10 |             min = i - 1 + n / i - 1
      |                                    ^
      |                                    ;
   11 |         }
      |         ~                           
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout << min;
      |     ^~~~
Language: C++

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

int main(void) {
    int n;
    int min;
    vector<int> vec;
    cin >> n;

    for(int i = 1; i <= n / 2; i++) {
        if (n % i == 0) {
            // vec.push_back(i - 1 + n / i - 1);
            min = i - 1 + n / i - 1
        }
    }

    // min = vec[0];
    // for (int i = 1; i < vec.size(); i++)
    //     if (vec[i] < min) min = vec[i];
    
    cout << min;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:36: error: expected ';' before '}' token
   13 |             min = i - 1 + n / i - 1
      |                                    ^
      |                                    ;
   14 |         }
      |         ~
Language: C++

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

int main(void) {
    int n;
    int min;
    vector<int> vec;
    cin >> n;

    for(int i = 1; i < 2 / n; i++) {
        if (n % i == 0) {
            vec = i - 1 + n / i - 1;
        }
    }

    min = vec[0];
    for (int i = 1; i < vec.size(); i++)
        if (vec[i] < min) min = vec[i];
    
    cout << min;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:35: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
   12 |             vec = i - 1 + n / i - 1;
      |                                   ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: Java

package wolkOnMultiplicationTable;


/**
 * @author yoshizaki
 *
 */
public class walkOn {

public static void main(String[] args) {
    long start = System.currentTimeMillis(); 
    int ans = calc(Integer.parseInt(args[0]));
    long end = System.currentTimeMillis(); 
    long time = end - start;
    System.out.println(ans + "回");
    System.out.println(time +"ms");
}

public static  int calc(int target){
    int divNum = 0;
    int ansNum = 0;
    int sumNum = 0;
    for (int i= 1; i <= target/2 ; i++) {
        if (target % i == 0)
        {
            divNum = i ;
            ansNum = target / i;
        }
        if ( divNum + ansNum < sumNum || sumNum == 0  )
        sumNum = divNum + ansNum ;
    }
    return sumNum -2;
}

}


Compiler output:
Main.java:8: error: class walkOn is public, should be declared in a file named walkOn.java
public class walkOn {
       ^
1 error
Language: Java

import java.util.*;

public class test{
    public static void main(String[] args){
        Scaner sc = new Scanner(System.in);
        long N  = sc.nextLong();
        double limit = Math.sqrt(N);
        long min = N;
        for(int i = 0; i < limit; i++){
            if(N % i != 0) continue;
            long j = N/i;
            min = Math.min(i, j);
        }
        System.out.println(min);
    }
}

Compiler output:
Main.java:3: error: class test is public, should be declared in a file named test.java
public class test{
       ^
Main.java:5: error: cannot find symbol
        Scaner sc = new Scanner(System.in);
        ^
  symbol:   class Scaner
  location: class test
2 errors
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Sccaner sc = new Scanner(System.in);
        long N  = sc.nextLong();
        double limit = Math.sqrt(N);
        long min = N;
        for(int i = 0; i < limit; i++){
            if(N % i != 0) continue;
            long j = N/i;
            min = Math.min(i, j);
        }
        System.out.println(min);
    }
}

Compiler output:
Main.java:5: error: cannot find symbol
        Sccaner sc = new Scanner(System.in);
        ^
  symbol:   class Sccaner
  location: class Main
1 error
Language: C

#include <stdio.h>

typedef long long ll;

ll min(ll x, y) {
  return x < y ? x : y;
}

int main() {
  ll n;
  scanf("%lld", &n);

  ll ans = n;
  for (ll i = 1; i*i <= n; i++) {
    if (n % i == 0) {
      ans = min(ans, i + n/i - 2);
    }
  }
  printf("%lld\n", ans);

  return 0;
}

Compiler output:
main.c:5:14: error: unknown type name 'y'
    5 | ll min(ll x, y) {
      |              ^
main.c: In function 'main':
main.c:16:13: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   16 |       ans = min(ans, i + n/i - 2);
      |             ^~~
      |             main
Language: C

#include <stdio.h>

typedef long long ll;

int main() {
  ll n;
  scanf("%lld", &n);

  ll ans = n;
  for (ll i = 1; i*i <= n; i++) {
    if (n % i == 0) {
      ans = min(ans, i + n/i - 2);
    }
  }
  printf("%lld\n", ans);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:13: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   12 |       ans = min(ans, i + n/i - 2);
      |             ^~~
      |             main
Language: C++

#include <iostream>
#include <cmath>
using namespace std;

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

	int sq = sqrt(N)
	long int d = 1 + N;
	long int j = 0;
	long int td = 0;
	for (long int i = 1; i <= sq; i++) {
		if (N % i != 0) continue;
		j = N / i;
		td = (i - 1) + (j - 1);
		if (td < d) {
			d = td;
		}
	}
	cout << d << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected ',' or ';' before 'long'
   10 |         long int d = 1 + N;
      |         ^~~~
a.cc:17:26: error: 'd' was not declared in this scope
   17 |                 if (td < d) {
      |                          ^
a.cc:21:17: error: 'd' was not declared in this scope; did you mean 'td'?
   21 |         cout << d << endl;
      |                 ^
      |                 td
Language: C++

#include <iostream>
#include <cmath>

int main() {
    int N = 0;
    std::cin >> N;
    int len = N - 1;
    int sqN = std::sqrt(N);

    for (int i = 1; i < ; i++)
        if (N % i == 0)
            len = std::min(len, i + N / i - 2);
        else continue;
    
    std::cout << len << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: expected primary-expression before ';' token
   10 |     for (int i = 1; i < ; i++)
      |                         ^
Language: C++

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

int main()
{
    int N;
    cin >> N;
    int minstep = N - 1;
    for (int i = 2; i < sqrt(N) / 2; i++)
    {
        if (N % i == 0)
        {
            if (minstep > i + N / i)
            {
                minstep = i + N / i - 2;
            }
        }
    }
    cout << minstep << endl;
    return 0;
}

Compiler output:
a.cc:2:11: error: missing terminating > character
    2 | #include <
      |           ^
a.cc:2:10: error: empty filename in #include
    2 | #include <
      |          ^
a.cc: In function 'int main()':
a.cc:10:25: error: 'sqrt' was not declared in this scope
   10 |     for (int i = 2; i < sqrt(N) / 2; i++)
      |                         ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  int a,c;
  cin >> N;
  for (int i = 1; i < N/2; ++i){
    a = N - 1;
    if (N % i == 0){
      c = (N % i) + i;
      if (c < a){
        a = c;
      }
    }
    return a;
  }
}
cout << a << endl;


Compiler output:
a.cc:19:1: error: 'cout' does not name a type
   19 | cout << a << endl;
      | ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  int a,c;
  cin >> N;
  for (i = 1; i < N/2; ++i){
    a = N - 1;
    if (N % i == 0){
      c = (N % i) + i;
      if (c < a){
        a = c;
      }
    }
    return a;
  }
}
cout << a << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i = 1; i < N/2; ++i){
      |        ^
a.cc: At global scope:
a.cc:19:1: error: 'cout' does not name a type
   19 | cout << a << endl;
      | ^~~~
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long min = 0;
		long x = (long) Math.sqrt((double)N);
		for(int i = x;i > 0;i--){
			if(N % i == 0) min = i;
		}

		System.out.println(min - 1 + N/min - 1);
	}
}










Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from long to int
		for(int i = x;i > 0;i--){
		            ^
1 error
Language: C++

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

typedef long long ll;

int main() {
	ll n; cin >> n;
	ll mini = (ll)1e15;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0) {
			mini = min(mini, i + (n / i) - 2);
		}
	}
	cout << mini << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: 'sqrt' was not declared in this scope
   10 |         for (int i = 1; i <= sqrt(n); i++) {
      |                              ^~~~
Language: C++

#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
  	int middle = 1;	
  	for (int i = 1; i < n; i++) {
    	if (i * i > n) {
          	middle = i;
        	break;
        }
    }
  	int x,y;
  	for (i = middle; i >= 1; i--) {
    	if (n % i == 0) {
        	x = i;
            y = n / i;
        }
    }
  	cout << x + y -2 << endl;
  	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: 'i' was not declared in this scope
   16 |         for (i = middle; i >= 1; i--) {
      |              ^
Language: C++

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

int main(void){
long long int N,Min = 1e9,j = 0;
  std::cin >> N;
  for(long long int i = 1;i <= sqrt(N);i++){
    if(N % i == 0){
j = N / i;
      Min = min(Min,i + j);
}
}
  std::cout<<Min<<std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'min' was not declared in this scope; did you mean 'std::min'?
   11 |       Min = min(Min,i + j);
      |             ^~~
      |             std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include<iostream>
#include<algorithm>

int main(void){
long long int N,Min = 1e9,j = 0;
  std::cin >> N;
  for(long long int i = 1;i <= sqrt(N);i++){
    if(N % i == 0){
j = N / i;
      Min = min(Min,i + j);
}
}
  std::cout<<Min<<std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:32: error: 'sqrt' was not declared in this scope
    7 |   for(long long int i = 1;i <= sqrt(N);i++){
      |                                ^~~~
a.cc:10:13: error: 'min' was not declared in this scope; did you mean 'std::min'?
   10 |       Min = min(Min,i + j);
      |             ^~~
      |             std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include<iostream>

using namespace std;

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

	long long int answer = pow(10, 13);

	long long int Q = pow(10, 6);

	for (long long int i = 1; i <= Q; i++) {
		
		
		long long int W = N % i;

		//cout << i << endl;
		
		if (W == 0) {
			long long int E = N / i;
			long long int R = (i - 1) + (E - 1);

			//cout << R << endl;
			
			if (R < answer) {
				answer = R;
			}
			
		}
	}

	cout << answer << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: 'pow' was not declared in this scope
    9 |         long long int answer = pow(10, 13);
      |                                ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(void){
  ll n;
  cin >> n;
  ll mn = LLONG_MAX;
  for(ll i = 1; i * i <= n; i++){
    if(n % i == 0){
      ll a = i - 1, b = n / i - 1;
      mn = min(mn , a + b);
    }
  }
  cout << mn << endl;
  return 0;

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(void){
  ll n;
  cin >> n;
  ll mn = LLONG_MAX;
  for(ll i = 1; i <= n / 2; i++){
    if(n % i == 0){
      ll a = i - 1, b = n / i - 1;
      mn = min(mn , a + b);
    }
  }
  cout << mn << endl;
  return 0;

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

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

int main(){
  int j,i,a,b;
  double N
  cin >> N;
  for(i=1; i<=sqrt(N);i++){
    if(N%i==0){
      j  = N/i;
      if(i>j){
        break;
      }
      a=i;
      b=j;
    }
  }
  if(a==1){
    b=N;
  }
    cout << a+b-2 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'cin'
    7 |   cin >> N;
      |   ^~~
a.cc:8:20: error: 'N' was not declared in this scope
    8 |   for(i=1; i<=sqrt(N);i++){
      |                    ^
a.cc:19:7: error: 'N' was not declared in this scope
   19 |     b=N;
      |       ^
Language: C++

int main(int argc, const char * argv[]) {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    uint64_t n;
    cin >> n;
    vector<uint64_t> yakusu(0);
    find_yakusu(n, yakusu);
    uint64_t i= sqrt(n);
    bool res = false;
    while(i!=1){
        if(n%i == 0){
            cout << n/i + i -2 << endl;
            res = true;
            break;
        }
        i--;
    }
    if(!res){
        cout << n - 1 << endl;
    }
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin.tie(0);
      |     ^~~
a.cc:4:5: error: 'ios' has not been declared
    4 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:6:5: error: 'uint64_t' was not declared in this scope
    6 |     uint64_t n;
      |     ^~~~~~~~
a.cc:1:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | int main(int argc, const char * argv[]) {
a.cc:7:12: error: 'n' was not declared in this scope
    7 |     cin >> n;
      |            ^
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<uint64_t> yakusu(0);
      |     ^~~~~~
a.cc:8:22: error: 'yakusu' was not declared in this scope
    8 |     vector<uint64_t> yakusu(0);
      |                      ^~~~~~
a.cc:9:5: error: 'find_yakusu' was not declared in this scope
    9 |     find_yakusu(n, yakusu);
      |     ^~~~~~~~~~~
a.cc:10:13: error: expected ';' before 'i'
   10 |     uint64_t i= sqrt(n);
      |             ^~
      |             ;
a.cc:12:11: error: 'i' was not declared in this scope
   12 |     while(i!=1){
      |           ^
a.cc:14:13: error: 'cout' was not declared in this scope
   14 |             cout << n/i + i -2 << endl;
      |             ^~~~
a.cc:14:35: error: 'endl' was not declared in this scope
   14 |             cout << n/i + i -2 << endl;
      |                                   ^~~~
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << n - 1 << endl;
      |         ^~~~
a.cc:21:26: error: 'endl' was not declared in this scope
   21 |         cout << n - 1 << endl;
      |                          ^~~~
Language: Java

import java.util.Scanner;

public class C {

    public static void main(String[] args) {
        Scanner sc = new java.util.Scanner(System.in);

        long N = sc.nextLong();
        double upper = Math.sqrt(N);
        long min = N;
        for (int i = 1; i <= upper; i++) {
            if (N % i == 0) {
                long j = N / i;
                min = Math.min(min, i + j - 2);
            }
        }
        System.out.println(min);
    }

}

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

#include <stdio.h>
#include <limits.h>

long long min(long long a, long long b){
    return (a < b ? a : b);
}

int main(){
	long long n, ans = LONG_MAX;
	scanf("%lld", &n);
	for(long long i = 1; i * i <= n; i++){
		if(n % i == 0){
            ans = min(ans, i + N / i - 2);
		}
	}
	printf("%lld\n", ans);
}

Compiler output:
main.c: In function 'main':
main.c:13:32: error: 'N' undeclared (first use in this function)
   13 |             ans = min(ans, i + N / i - 2);
      |                                ^
main.c:13:32: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;
typedef long long ll;
int main() {
	ll n;
	cin >> n;
	ll min = 1e12;
	ll ans = 0;
	for (ll i = 0; i * i < n; i++) {
		if (n % i != 0) {
			continue;
		}
		else {
			ll j = n / i;
			 ans = min(ans, i + j - 2);
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:35: error: 'min' cannot be used as a function
   15 |                          ans = min(ans, i + j - 2);
      |                                ~~~^~~~~~~~~~~~~~~~
Language: C++

#include<bist/stdc++.h>

using namespace std;

int main(){
  long long n;
  cin >> n;
  long long ans = n+1;
  for(long long i = 1; i <= sqrt(n); i++){
    if( n%i == 0 ){
      long long j = n/i;
      if( i+j < ans )
        ans = i+j;
    }
  }
  cout << ans << endl;
  return 0;
}

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

#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#define rep(i, n) for (int i=0;i<n;i++);
using namespace std;
typedef long long ll;

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

    ll N;
    cin >> N;
    ll result = N - 1;
    for(ll i=1;i<=sqrt(N);i++){
        result = min(result, i + (N/j) - 2);
    }
    cout << result << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:37: error: 'j' was not declared in this scope
   19 |         result = min(result, i + (N/j) - 2);
      |                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
typedef long long ll;
typedef long long unsigned int llu;
ll MOD = 1000000007;
ll INF = 1000000009;


void solve(){
  double n;
  cin >> n;
  double tmp = sqrt(n);
  tmp = floor(tmp);
  int i = (int)tmp;
  while(true){
    if(n%i==0){
      cout << i+(n/i)-2 << endl;
      break;
    }
    else{
      i++;
    }
  }
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:17:9: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   17 |     if(n%i==0){
      |        ~^~
      |        | |
      |        | int
      |        double
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
     long long n=0,a=1,b=1;
    scanf("%lld",&n);
    
    for(int i=2;i*i<=n;i++){
        if(n%i==0){
            a=i;
            b=n/i;
            c=a+b;
        }

    }
    
        printf("%lld",c-2);
    
}


Compiler output:
main.c: In function 'main':
main.c:11:13: error: 'c' undeclared (first use in this function)
   11 |             c=a+b;
      |             ^
main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <stdio.h>
#include <math.h>
int main(){
  int n;
  scanf("%d",&n)
  for(int i = (int) sqrt((double) n); 1<i; i--){
    if(n%i == 0){
      printf("%d\n",(n/i + i - 2));
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: expected ';' before 'for'
    5 |   scanf("%d",&n)
      |                 ^
      |                 ;
    6 |   for(int i = (int) sqrt((double) n); 1<i; i--){
      |   ~~~            
a.cc:6:41: error: 'i' was not declared in this scope
    6 |   for(int i = (int) sqrt((double) n); 1<i; i--){
      |                                         ^
Language: Java

import java.util.*;

public class Sample {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
    
    int i = 1;
    int j = n;
    
    int min = i + j - 2;
    
    for(int x = 1; x <= n; x++) {
	    for(int y = 1; y <= x; x++) {
          if(x * y == n && (x + y - 2) < n) {
            min = x + y - 2;
          }
        }
    }
    
    System.out.println(min);
    }
    
  }
  


Compiler output:
Main.java:3: error: class Sample is public, should be declared in a file named Sample.java
public class Sample {
       ^
1 error
Language: Java

import java.util.*;
import java.Math.*;


public Sample {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
    
    int i = 1;
    int j = n;
    
    int min = i + j - 2;
    
    for(int x = 1; x <= n; x++) {
	    for(int y = 1; y <= x; x++) {
          if(x * y == n && (x + y - 2) < n) {
            min = x + y - 2;
          }
        }
    }
    
    System.out.println(min);
    }
    
  }
  

Compiler output:
Main.java:5: error: class, interface, enum, or record expected
public Sample {
       ^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
  public static void main(String[] args){
                ^
  (use --enable-preview to enable unnamed classes)
Main.java:26: error: class, interface, enum, or record expected
  }
  ^
3 errors
Language: C++

n = int(input())
data = []
N = n
count = 2

def pi(lis):
  ans = 1
  for i in range(len(lis)):
    ans =ans * lis[i]
  return ans


while count <= int(N**(1/2)+4):
  if n % count == 0:
    n = n / count
    data.append(count)
    continue
  else:
    count += 1
#print(n,count,int(N**(1/2) + 5),'n,count')
if (count == int(N**(1/2) + 5)) and n != 0:
    data.append(n)
      
#print(data)
sum_data = []
if len(data) == 1:
  print(int(data[0])-1)
  exit()
if len(data) == 2:
  print(int(data[0] + data[1])-2)
  exit()
for i in range(1,len(data)):
  sum_data.append(pi(data[:i]) + pi(data[i:])-2)


#print(sum_data,'sum_data')
#print(data,'data')
#print(pi([2,5,5,1]))
print(int(min(sum_data)))


Compiler output:
a.cc:20:2: error: invalid preprocessing directive #print
   20 | #print(n,count,int(N**(1/2) + 5),'n,count')
      |  ^~~~~
a.cc:24:2: error: invalid preprocessing directive #print
   24 | #print(data)
      |  ^~~~~
a.cc:36:2: error: invalid preprocessing directive #print
   36 | #print(sum_data,'sum_data')
      |  ^~~~~
a.cc:37:2: error: invalid preprocessing directive #print
   37 | #print(data,'data')
      |  ^~~~~
a.cc:38:2: error: invalid preprocessing directive #print
   38 | #print(pi([2,5,5,1]))
      |  ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: Java

import java.util.*;
import java.math.*;
public class x{
  public static void main(String[] args)
  {
    Scanner s=new Scanner(System.in);
    long  n=s.nextLong();
    long ans=n-1;
    for(int i=1;i*i<=n;i++)
    {
       if(n%i==0)
       {
         ans=Math.min(ans,(i+n/i-2));
       }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:3: error: class x is public, should be declared in a file named x.java
public class x{
       ^
1 error
Language: Java

import java.util.*;
import java.math.*;
public class x{
  public static void main(String[] args)
  {
    Scanner s=new Scanner(System.in);
    long  n=s.nextLong();
    long ans=n-1;
    for(int i=1;i*i<=n;i++)
    {
       if(a%i==0)
       {
         ans=Math.min(ans,(i+a/i-2));
       }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:3: error: class x is public, should be declared in a file named x.java
public class x{
       ^
Main.java:11: error: cannot find symbol
       if(a%i==0)
          ^
  symbol:   variable a
  location: class x
Main.java:13: error: cannot find symbol
         ans=Math.min(ans,(i+a/i-2));
                             ^
  symbol:   variable a
  location: class x
3 errors
Language: Java

import java.util.*;
import java.math.*;
class x{
  public static void main(String[] args)
  {
    Scanner s=new Scanner(System.in);
    long  n=s.nextLong();
    long ans=n-1;
    for(int i=1;i*i<=n;i++)
    {
       if(a%i==0)
       {
         ans=Math.min(ans,(i+a/i-2));
       }
    }
    System.out.println(ans);
      

Compiler output:
Main.java:16: error: reached end of file while parsing
    System.out.println(ans);
                            ^
1 error
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i <(n) ; ++i)
using namespace std;
using ll = long long;
void self_max(int &a,int b){
	a = max(a,b);
}
void self_min(ll &a,ll b){
	a = min(a,b);
}

int main(){
	ll a; cin >> a;
	ll t = __gcd(a);
	if(t == a ){
		cout << a-1 << endl;
		return 0;
	}
	ll ans = LONG_MAX;
	for(ll i=1; i<=t ; i++){
		if(a%i == 0){
			self_min(ans,(i+ a/i));
		}
	}
	
	cout << ans-2 << endl;	
	
	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: no matching function for call to '__gcd(ll&)'
   14 |         ll t = __gcd(a);
      |                ~~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   candidate expects 2 arguments, 1 provided
Language: Java

import java.util.*;
public class Main{
public static void main(String args){
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
long c1 = new long[10000];
long c2 = new long[10000];
int g=0;
long a=Long.MAX_VALUE;
long y = new long[10000];
for(long i=1;i<(long)Math.sqrt(n)+1;i++){
if(n%i==0){
c1[g] = i;
c2[g] = n/i;
g+=1;
}
}
for(int i=0;i<g;i++){
a = Math.min(a,c1[i]+c2[i]-2);
}
System.out.println(a);
}
}

Compiler output:
Main.java:6: error: incompatible types: long[] cannot be converted to long
long c1 = new long[10000];
          ^
Main.java:7: error: incompatible types: long[] cannot be converted to long
long c2 = new long[10000];
          ^
Main.java:10: error: incompatible types: long[] cannot be converted to long
long y = new long[10000];
         ^
Main.java:13: error: array required, but long found
c1[g] = i;
  ^
Main.java:14: error: array required, but long found
c2[g] = n/i;
  ^
Main.java:19: error: array required, but long found
a = Math.min(a,c1[i]+c2[i]-2);
                 ^
Main.java:19: error: array required, but long found
a = Math.min(a,c1[i]+c2[i]-2);
                       ^
7 errors
Language: Java

import java.util.*;
 
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    long n = scan.nextLong();
    long c1[] = new long[1000];
    long c2[] = new long[1000];
    long a=Long.MAX_VALUE;
    int g = 0;
    
    for(int i=1;i<Math.sqrt(n);i++){
    	if(n%i==0){
        	c1[g]=i;
          	c2[g]=n/i;
          	g++;
        }
    }
    
    for(int j=0;j<g;j++){
      a = Math.min(a,c1[i]+c2[i]-2);
    }
    System.out.println(a);
  }
}


Compiler output:
Main.java:21: error: cannot find symbol
      a = Math.min(a,c1[i]+c2[i]-2);
                        ^
  symbol:   variable i
  location: class Main
Main.java:21: error: cannot find symbol
      a = Math.min(a,c1[i]+c2[i]-2);
                              ^
  symbol:   variable i
  location: class Main
2 errors
Language: Java

import java.util.*;
 
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    long n = scan.nextLong();
    long c1[] = new long[1000];
    long c2[] = new long[1000];
    long a=Long.MAX_VALUE;
    int g = 0;
    
    for(int i=1;i<Math.sqrt(n);i++){
    	if(n%i==0){
        	a[g]=i;
          	b[g]=n/i;
          	g++;
        }
    }
    
    for(int j=0;j<g;j++){
      a = Math.min(a,c1[i]+c2[i]-2);
    }
    System.out.println(a);
  }
}

Compiler output:
Main.java:14: error: array required, but long found
        	a[g]=i;
        	 ^
Main.java:15: error: cannot find symbol
          	b[g]=n/i;
          	^
  symbol:   variable b
  location: class Main
Main.java:21: error: cannot find symbol
      a = Math.min(a,c1[i]+c2[i]-2);
                        ^
  symbol:   variable i
  location: class Main
Main.java:21: error: cannot find symbol
      a = Math.min(a,c1[i]+c2[i]-2);
                              ^
  symbol:   variable i
  location: class Main
4 errors