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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;

int main() {
    ll A ;
    cin >> A ;
    ll B =1e18;
    for(ll i=1;i*i<=n;++i){
        if(A%i!=0)continue;
        ll j = n/i;
        B =min(B,i+j-2)
    }
 cout << B << endl;

    return 0;    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'n' was not declared in this scope
   11 |     for(ll i=1;i*i<=n;++i){
      |                     ^
a.cc:14:24: error: expected ';' before '}' token
   14 |         B =min(B,i+j-2)
      |                        ^
      |                        ;
   15 |     }
      |     ~
Language: C++


int main(){
  
long long a;
  cin >> a;
  long long b;
  long long x = a; 
    long long  y = sqrt(x);
  for(int i = y;i > 0 ; i--) {//ルートa以下でみて一番大きい約数で終了
    if(a % i == 0) {
      b = i;
      break;
      
    }
  }
    long long  d = b;
    long long  e = a/d;

    cout << d + e -2 << endl;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> a;
      |   ^~~
a.cc:8:20: error: 'sqrt' was not declared in this scope
    8 |     long long  y = sqrt(x);
      |                    ^~~~
a.cc:19:5: error: 'cout' was not declared in this scope
   19 |     cout << d + e -2 << endl;
      |     ^~~~
a.cc:19:25: error: 'endl' was not declared in this scope
   19 |     cout << d + e -2 << endl;
      |                         ^~~~
Language: C++

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

int main(){
  
long long a;
  cin >> a;
  long long b;
  long long x = a; 
    long long  y = sqrt(x);
  for(int i = y;i > 0 ; i--) {//ルートa以下でみて一番大きい約数で終了
    if(a % i == 0) {
      break;
      
    }
  }
    long long  d = i;
    long long  e = a/d;

    cout << d + e -2 << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: 'i' was not declared in this scope
   17 |     long long  d = i;
      |                    ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int main(){
  long long N;
  cin>>N;
  long long x=sqrt(N)+1;
  while(n%x!=0){
    x--;
  }
  cout<<x+n/x-2;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'n' was not declared in this scope
    8 |   while(n%x!=0){
      |         ^
a.cc:11:11: error: 'n' was not declared in this scope
   11 |   cout<<x+n/x-2;
      |           ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int main(){
  long long N;
  long long x=sqrt(N)+1;
  cin>>N;
  while(n%x!=0){
    x--;
  }
  cout<<x+n/x-2;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'n' was not declared in this scope
    8 |   while(n%x!=0){
      |         ^
a.cc:11:11: error: 'n' was not declared in this scope
   11 |   cout<<x+n/x-2;
      |           ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int main(){
  long long N;
  long long x=sqrt(N)+1;
  cin>>N;
  while(n%x!=0){
    x--;
  }
  cout<<x+n/x-2
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'n' was not declared in this scope
    8 |   while(n%x!=0){
      |         ^
a.cc:11:11: error: 'n' was not declared in this scope
   11 |   cout<<x+n/x-2
      |           ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  ll ans=100000000;
  for(ll int i=1;i*i<=n;i++){
    if(n%i==0 && ans>i+(n/i)-2){
      ans=min(ans,(n/i)+i-2);
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: two or more data types in declaration of 'i'
    9 |   for(ll int i=1;i*i<=n;i++){
      |       ^~
a.cc:9:18: error: 'i' was not declared in this scope
    9 |   for(ll int i=1;i*i<=n;i++){
      |                  ^
Language: C++

#include <iostream>
#include <math>
 
int main()
{
  long long int N=0;
  std::cin >> N;
  long long int sqrt_N = (long long int)std::sqrt(N);
  
  long long int _min = 2 * N;
  for(long long int k=sqrt_N; k>1; --k){
    if(N % k == 0){
      long long int temp =  k + (N / k) - 2;
      if(temp < _min) {
        _min = temp;
      }
    }
  }
  std::coutt << _min;
  
  return 0;
}

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

#include <iostream>
#include <cmath>
 
int main()
{
  long long int N=0;
  std::cin >> N;
  long long int sqrt_N = (long long int)std::sqrt(N);
  
  long long int min = 2 * N;
  for(long long int k=sqrt_N; k>1; --k){
    if(N % k == 0){
      long long int temp =  k + (N / k) - 2;
      if(temp < max) {
        min = temp;
      }
    }
  }
  std::cout << min;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'max' was not declared in this scope; did you mean 'std::max'?
   14 |       if(temp < max) {
      |                 ^~~
      |                 std::max
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:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		long NN = sc.nextLong();
		long a = 0;
		long b = 0; 
		long A = 0,B = 0;      
		for( int i=1; i*i<=N; i++ ){
			a++;
			b = NN/a;
			if( NN%a==0 ){
				A = a;
				B = b;              
			}
			if( a>=b ){
				break;              
            }              
			if( i*i==N ){
				A = NN;
				B = 1;
			}
		}
		System.out.println((A-1)+(B-1));
	}
}


Compiler output:
Main.java:10: error: cannot find symbol
		for( int i=1; i*i<=N; i++ ){
		                   ^
  symbol:   variable N
  location: class Main
Main.java:20: error: cannot find symbol
			if( i*i==N ){
			         ^
  symbol:   variable N
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <cmath>
 
int main()
{
  long long int N=0;
  std::cin >> N;
  long long int sqrt_N = (long long int)std::sqrt(N);
  
  long long int min = 2 * N;
  for(long long int k=sqrt_N; k>1; --k){
    if(N % k == 0){
      long long int temp =  k + (N / k) - 2;
      if(temp < max) {
        min = temp;
      }
    }
  }
  std::coutt << min;
  
  return 0;
}
#include <iostream>
#include <math>
 
int main()
{
  long long int N=0;
  std::cin >> N;
  long long int sqrt_N = (long long int)std::sqrt(N);
  
  long long int min = 2 * N;
  for(long long int k=sqrt_N; k>1; --k){
    if(N % k == 0){
      long long int temp =  k + (N / k) - 2;
      if(temp < max) {
        min = temp;
      }
    }
  }
  std::coutt << min;
  
  return 0;
}

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

#include <iostream>
#include <math>
 
int main()
{
  long long int N=0;
  std::cin >> N;
  long long int sqrt_N = (long long int)std::sqrt(N);
  
  long long int min = 2 * N;
  for(long long int k=sqrt_N; k>1; --k){
    if(N % k == 0){
      long long int temp =  k + (N / k) - 2;
      if(temp < max) {
        min = temp;
      }
    }
  }
  std::coutt << min;
  
  return 0;
}

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

import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		long NN = sc.nextLong();
		long a = 0;
		long b = 0; 
		long A = 0,B = 0;      
		for( int i=1; i*i<=N; i++ ){
			a++;
			b = NN/a;
			if( NN%a==0 ){
				A = a;
				B = b;              
			}
			if( a>=b ){
				break;              
            }              
			if( i==c ){
				A = NN;
				B = 1;
			}
		}
		System.out.println((A-1)+(B-1));
	}
}


Compiler output:
Main.java:10: error: cannot find symbol
		for( int i=1; i*i<=N; i++ ){
		                   ^
  symbol:   variable N
  location: class Main
Main.java:20: error: cannot find symbol
			if( i==c ){
			       ^
  symbol:   variable c
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <math>

int main()
{
  long long int N=0;
  std::cin >> N;
  long long int sqrt_N = (long long int)std::sqrt(N);
  
  for(long long int k=sqrt_N; k>1; --k){
    if(N % k == 0){
      std::cout << k + (N / k) - 2;
    }
  }
  
  return 0;
}

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

#include <stdio.h>
#include<math.h>
#include<>

int main(void)
{
  unsigned long long N, i,j;
  unsigned long long a = INFINITY, b = INFINITY;
  double C;
  scanf("%llu", &N);
  //N = 10000000019;
  for (i = 1; i <= sqrt(N); i++)
  {
    C = N / i;
    if(N % i == 0){
      j = N / i;
      if(i + j < a + b - 2){
        a = i;
        b = j;
      }
    }
  }
  //printf("%llu %llu ", a, b);
  printf("%llu", a + b - 2);
}

Compiler output:
a.cc:3:9: error: empty filename in #include
    3 | #include<>
      |         ^~
a.cc: In function 'int main()':
a.cc:8:26: warning: overflow in conversion from 'float' to 'long long unsigned int' changes value from '+Inff' to '18446744073709551615' [-Woverflow]
    8 |   unsigned long long a = INFINITY, b = INFINITY;
      |                          ^~~~~~~~
a.cc:8:40: warning: overflow in conversion from 'float' to 'long long unsigned int' changes value from '+Inff' to '18446744073709551615' [-Woverflow]
    8 |   unsigned long long a = INFINITY, b = INFINITY;
      |                                        ^~~~~~~~
Language: C++

#include<iostream>
#include <queue>
using namespace std;
using uint = unsigned int;
using ull = unsigned long long;

int main() {
	ull N;
	cin >> N;
	
	uint ans = N - 1;
	for (ull i=2; i<=sqrt(N); i++) {
		if (N % i == 0) {
			ans = min(ans, i + N / i - 2);
		}
	}
	
	cout << ans;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: 'sqrt' was not declared in this scope
   12 |         for (ull i=2; i<=sqrt(N); i++) {
      |                          ^~~~
a.cc:14:34: error: no matching function for call to 'min(uint&, ull)'
   14 |                         ans = min(ans, i + N / i - 2);
      |                               ~~~^~~~~~~~~~~~~~~~~~~~
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:14:34: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'ull' {aka 'long long unsigned int'})
   14 |                         ans = min(ans, i + N / i - 2);
      |                               ~~~^~~~~~~~~~~~~~~~~~~~
/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
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <climits>
using namespace std;

int main(){
  long int a,b;
  cin >> a;
  long int min = 0,t;

  for(int i = 1; i < squt(a);++i){
    if(a%i == 0){
      t = i-1+a/i-1;
      if(min == 0 || min > t){
        min = t;
      }
    }
  }




  cout << min << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: 'squt' was not declared in this scope; did you mean 'sqrt'?
   16 |   for(int i = 1; i < squt(a);++i){
      |                      ^~~~
      |                      sqrt
Language: C++

#include<iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: 'LONG_MAX' was not declared in this scope
    7 | long long int n,tem,ans=LONG_MAX;
      |                         ^~~~~~~~
a.cc:2:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include<iostream>
  +++ |+#include <climits>
    2 | 
a.cc:14:14: error: no matching function for call to 'min(long long int)'
   14 |       ans=min(tem-1+i-1);
      |           ~~~^~~~~~~~~~~
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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <utility>
#include <map>
#include <unordered_map>
using namespace std;
typedef long long int ll;

int main() {
  ll N;
  cin>>N;
  
  ll X=1000000000000;
  ll p=sqrt(N);
  
  for(int i=1;i<=p;++i){
    if(N%i==0){
      int j=N/i;
      int k=i+j;
      X=min(k,X);
    }
  }
  
  cout<<X-2<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:12: error: no matching function for call to 'min(int&, ll&)'
   24 |       X=min(k,X);
      |         ~~~^~~~~
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:24:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   24 |       X=min(k,X);
      |         ~~~^~~~~
/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:4:
/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:24:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |       X=min(k,X);
      |         ~~~^~~~~
Language: Java

import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    int max = 0;
    for (int i = 1; i * i < n; i++)
      if (n % i == 0)
        max = i;
    System.out.println(max + N / max - 2);
  }
}

Compiler output:
Main.java:11: error: cannot find symbol
    System.out.println(max + N / max - 2);
                             ^
  symbol:   variable N
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define sz(x) ll(x.size())
using namespace std;

int main() {
	ll n,ans,a,b;
	cin n;
	ans=n;
	for(ll i=2;i*i<=n;i++){
		a=i;
		if(b%i!=0) continue;
		b=n/i;
		ans=min(ans.a+b-2);
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before 'n'
    9 |         cin n;
      |            ^~
      |            ;
a.cc:15:29: error: request for member 'a' in 'ans', which is of non-class type 'll' {aka 'long long int'}
   15 |                 ans=min(ans.a+b-2);
      |                             ^
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define sz(x) ll(x.size())
using namespace std;

int main() {
	ll n ans,a,b;
	cin n;
	ans=n;
	for(ll i=2;i*i<=n;i++){
		a=i;
		if(b%i!=0) continue;
		b=n/i;
		ans=min(ans.a+b-2);
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected initializer before 'ans'
    8 |         ll n ans,a,b;
      |              ^~~
a.cc:9:12: error: expected ';' before 'n'
    9 |         cin n;
      |            ^~
      |            ;
a.cc:10:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |         ans=n;
      |         ^~~
      |         abs
a.cc:10:13: error: 'n' was not declared in this scope; did you mean 'yn'?
   10 |         ans=n;
      |             ^
      |             yn
a.cc:12:17: error: 'a' was not declared in this scope
   12 |                 a=i;
      |                 ^
a.cc:13:20: error: 'b' was not declared in this scope
   13 |                 if(b%i!=0) continue;
      |                    ^
a.cc:14:17: error: 'b' was not declared in this scope
   14 |                 b=n/i;
      |                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  long long int n;
  scanf("%lld",&n);
  long long int ans=1e15ll;
  for(long long int i=1ll;i<=(int)sqrt(n);i++){
    if(n%i){
      continue;
    }
    ans=min(ans,i+(ans/i));
  }
  printf("%lld\n",ans-2);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: unable to find numeric literal operator 'operator""ll'
    8 |   long long int ans=1e15ll;
      |                     ^~~~~~
Language: C++

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

int main() {
  
  long long n;
  cin >> n;
  
  vector<int> vec1(10*10*10*10*10*10);
  vector<int> vec2(10*10*10*10*10*10);
  int s=0;
  for (int i=0; i<10*10*10*10*10*10/*==10^6*/; i++) {
    if (n%(i+1)==0) {
      vec1.at(s)=i+1;
      vec2.at(s)=n/(i+1);
      s++;
    }
  }
  
  vector<int> vec3(10*10*10*10*10*10);
  for (int i=0; i<10*10*10*10*10*10; i++) vec3.at(i)=vec1.at(i)+vec2.at(i);
  
  long long t=10000000000000;
  for (int i=0; i<s; i++) t=min(t,vec3.at(i));
  
  cout << t-2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:32: error: no matching function for call to 'min(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   24 |   for (int i=0; i<s; i++) t=min(t,vec3.at(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: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:24:32: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   24 |   for (int i=0; i<s; i++) t=min(t,vec3.at(i));
      |                             ~~~^~~~~~~~~~~~~~
/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:
/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:24:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   24 |   for (int i=0; i<s; i++) t=min(t,vec3.at(i));
      |                             ~~~^~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<tuple>
#include<map>
#include<queue>
#include <math.h>
#define rep(i, n) rep2(i,0,n)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
using namespace std;
 
int main() {
	ll n;
	cin >> n;
	ll ans = 2 * n;
	for(int i=1,i<sqrt(n);++i) {
		if (n%i == 0) ans = min(ans, i + n / i);
	}
	cout << ans - 2 << endl;
}

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

#include<stdio.h>
#include<math.h>

int main(){

	long n;
	scanf("%ld",n);
	long a=1,b;
	long ans=n+60;
	while(sqrt(n)+5 >a){
		b=n/a;
		if(a*b==n && a+b-2 <ans){
			ans=a+b-2;
		}
		a++
	}
	printf("%ld",ans);
}

Compiler output:
main.c: In function 'main':
main.c:15:20: error: expected ';' before '}' token
   15 |                 a++
      |                    ^
      |                    ;
   16 |         }
      |         ~
Language: C

#include<bits/stdc++.h>
using namespace std;
int main ()
{   
    long long int n;
    long long int ans;
    cin>>n;
    ans=n+1;
    long long int i;
    for (i=1;i*i<=n;i++)
    {    if (n%i==0)
        ans=min(ans,i+n/i);
    }
    cout<<ans-2<<"\n";
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main ()
{   
    long long int n;
    long long int ans;
    cin>>n;
    ans=n+1;
    long long int i;
    for (i=1;i*i<=n;i++)
    {    if (n%i==0)
        ans=min(ans,i+n/i);
    }
    cout<<ans-2;
    return 0;
}


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

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

int main()
{
  int64_t N, i, tmp, answer;
  cin >> N;
  answer=N-1
  for(i=1;i<N;i++)
  {
    if(N%i==0)
    {
      tmp=i+N/i-2;
      answer=min(tmp,N-1);
    }
  }    
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected ';' before 'for'
    8 |   answer=N-1
      |             ^
      |             ;
    9 |   for(i=1;i<N;i++)
      |   ~~~        
a.cc:9:18: error: expected ';' before ')' token
    9 |   for(i=1;i<N;i++)
      |                  ^
      |                  ;
Language: C++

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

int main() {
  
  long long n;
  cin >> n;
  
  vector<long long> vec1(10*10*10*10*10*10);
  vector<long long> vec2(10*10*10*10*10*10);
  int s=0;
  for (int i=0; i<10*10*10*10*10*10; i++) {
    if (n%(i+1)==0) {
      vec1.at(s)=i+1;
      vec2.at(s)=n/(i+1);
      s++;
    }
  }
  
  vector<long long> vec3(10*10*10*10*10*10);
  for (int i=0; i<10*10*10*10*10*10; i++) vec3.at(i)=vec1.at(i)+vec2.at(i);
  
  int t=10000000;
  for (int i=0; i<s; i++) t=min(t,vec3.at(i));
  
  cout << t-2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:32: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
   24 |   for (int i=0; i<s; i++) t=min(t,vec3.at(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: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:24:32: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   24 |   for (int i=0; i<s; i++) t=min(t,vec3.at(i));
      |                             ~~~^~~~~~~~~~~~~~
/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:
/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:24:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |   for (int i=0; i<s; i++) t=min(t,vec3.at(i));
      |                             ~~~^~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;



#define rep(i,m,n) for(ll i=m;i<n;i++)

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

 ll n;
  cin >> n;
  
  ll sq= int(sqrt(double(n)))+1;

  ll res=n;

  for(ll i=sq;i>=1;i--){
   if(n%i==0) {
res=min(res,i+n/i-2);
break;
}
}
 cout << res << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:2: error: 'll' was not declared in this scope
   13 |  ll n;
      |  ^~
a.cc:14:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   14 |   cin >> n;
      |          ^
      |          yn
a.cc:16:5: error: expected ';' before 'sq'
   16 |   ll sq= int(sqrt(double(n)))+1;
      |     ^~~
      |     ;
a.cc:18:5: error: expected ';' before 'res'
   18 |   ll res=n;
      |     ^~~~
      |     ;
a.cc:20:9: error: expected ';' before 'i'
   20 |   for(ll i=sq;i>=1;i--){
      |         ^~
      |         ;
a.cc:20:15: error: 'i' was not declared in this scope
   20 |   for(ll i=sq;i>=1;i--){
      |               ^
a.cc:22:1: error: 'res' was not declared in this scope; did you mean 'rep'?
   22 | res=min(res,i+n/i-2);
      | ^~~
      | rep
a.cc:26:10: error: 'res' was not declared in this scope; did you mean 'rep'?
   26 |  cout << res << endl;
      |          ^~~
      |          rep
Language: C++

#include<bits/stdc++.h>
 
#define REP(i,s,N) for (int i=s;i<(N); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;

#define k 1e+13
ll ans = 0;

int main(){
	ll N;
	cin >> N;
	
	ll k = INF;
	ll x, y;
	REP(i,1,N){
		if(N%i==0){
			y=N/i;
			x=i;
			k=min(abs(y-x),k);
			if(k==abs(y-x)) ans = x + y - 2;
		}
	}
	
	
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected unqualified-id before numeric constant
    8 | #define k 1e+13
      |           ^~~~~
a.cc:15:12: note: in expansion of macro 'k'
   15 |         ll k = INF;
      |            ^
a.cc:21:30: error: no matching function for call to 'min(long long int, double)'
   21 |                         k=min(abs(y-x),k);
      |                           ~~~^~~~~~~~~~~~
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: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:21:30: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'double')
   21 |                         k=min(abs(y-x),k);
      |                           ~~~^~~~~~~~~~~~
/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:
/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:21:30: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   21 |                         k=min(abs(y-x),k);
      |                           ~~~^~~~~~~~~~~~
Language: Java

import java.util.Scanner;

public class ABC144C {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        long n = Long.parseLong(sc.next());

        long result = 0;

        // 素数の場合
        if (isPrime(n)) {
            result = n - 1;

        } else {

            // 平方根が整数の場合
            double sqrt = Math.sqrt(n);
            if (sqrt - (int) sqrt == 0) {
                result = (int) sqrt * 2 - 2;

            } else {

                for (long i = 2; i <= n / 2 && result == 0; i++) {
                    if (n % i == 0) {
                        if (isPrime(n / i)) {
                            result = n / i + i - 2;
                        }
                    }
                }
            }
        }

        System.out.println(result);
    }

    public static boolean isPrime(long num) {
        if (num < 2) return false;
        else if (num == 2) return true;
        else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

        double sqrtNum = Math.sqrt(num);
        for (long i = 3; i <= sqrtNum; i += 2) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }
}


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

#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T>
map<T, T> primeFactor(T n) {
	map<T, T> res;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			res[i] ++;
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return true;
}


#define in(x) cin >> x
#define out(x) cout << x
#define outn(x) cout << x << '\n'
#define outs(x) cout << x << ' '
#define rep(i,s,e) for(long i=s;i<e;i++)
#define repeq(i,s,e) for(long i=s;i<=e;i++)



int main() {
	ll n,i=1,j=1,ans;
	bool x=true;
	in(n);

	tmp=n/2;
	rep(i,0,tmp){
		if(n%(tmp-i)==0){
			ans=i;
		}
	}	

	outn(ans+(n/ans)-2);
	
	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:71:9: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   71 |         tmp=n/2;
      |         ^~~
      |         tm
Language: C

#include <stdio.h>
#include <math.h>

int main(void){
    int N;
    int k;
    
    if(scanf("%d",&N)==1){;

    	k = ceil(sqrt((double)N));

    	while(N % k != 0 && k < N){
        	k++;
    	}

    	int l = N/k;

    	printf("%d", k + l - 2);
    }

  	else{
      printf("Fail")
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:21: error: expected ';' before '}' token
   22 |       printf("Fail")
      |                     ^
      |                     ;
   23 |     }
      |     ~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  cin>>n;
  int max=1000000000000;
  for(int i=1;i<=n/2;i++)
  {
    int sum;
    if(n%i==0)
    {  sum=i+n/i;
       if(sum<=max);
         max=sum;
       else
         break;
    }
  }
  cout<<max-2;
  retrun 0;
}
  
    
    
      

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 'n' was not declared in this scope
    5 |   cin>>n;
      |        ^
a.cc:6:11: warning: overflow in conversion from 'long int' to 'int' changes value from '1000000000000' to '-727379968' [-Woverflow]
    6 |   int max=1000000000000;
      |           ^~~~~~~~~~~~~
a.cc:14:8: error: expected '}' before 'else'
   14 |        else
      |        ^~~~
a.cc:11:5: note: to match this '{'
   11 |     {  sum=i+n/i;
      |     ^
a.cc: At global scope:
a.cc:18:3: error: 'cout' does not name a type
   18 |   cout<<max-2;
      |   ^~~~
a.cc:19:3: error: 'retrun' does not name a type
   19 |   retrun 0;
      |   ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

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

int main() {
  ll n, ans, a; cin >> n;
  ll b = n;
  
  for (int i=1; i<n; ++i) {
    if (i > b) {
      ans = (a-1) + (b-1);
      break;
    }
    if ((n%i) == 0) {
      a = i;
    } if ((n%i) == 0) {
      b = n/i;
    }
    } else continue;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 'else' without a previous 'if'
   20 |     } else continue;
      |       ^~~~
a.cc:20:12: error: continue statement not within a loop
   20 |     } else continue;
      |            ^~~~~~~~
a.cc: At global scope:
a.cc:22:3: error: 'cout' does not name a type
   22 |   cout << ans << endl;
      |   ^~~~
a.cc:23:3: error: expected unqualified-id before 'return'
   23 |   return 0;
      |   ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (ll i=1; i<=(n); i++)
typedef long long ll;
using namespace std;
 
int main(){
    ll N; cin >> N;
    ll ans=0;
    vector <ll> A(0,0);
    ll k=-1;
    
    rep(i,pow(10,6)){
        if(N%i==0){
            A.push_back(i);
            k++;
            if(k>=1 && (A[k]*A[k-1]==N || A[k]*A[k]==N))break;
        }
    }
    if(A.size()==1) cout << N-1;
   if(size%2!=0){
        if(A[size-1]*A[size-2]==N){
            ans=A[size-2]+A[size-1]-2;
            cout << ans;
        }else{
            ans=A[size-2]+A[size-3]-2;
            cout << ans;
        }
    }
    return 0;
}    

Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator%'
   20 |    if(size%2!=0){
      |       ~~~~^~
a.cc:21:18: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   21 |         if(A[size-1]*A[size-2]==N){
      |              ~~~~^~
a.cc:21:28: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   21 |         if(A[size-1]*A[size-2]==N){
      |                        ~~~~^~
a.cc:22:23: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   22 |             ans=A[size-2]+A[size-1]-2;
      |                   ~~~~^~
a.cc:22:33: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   22 |             ans=A[size-2]+A[size-1]-2;
      |                             ~~~~^~
a.cc:25:23: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   25 |             ans=A[size-2]+A[size-3]-2;
      |                   ~~~~^~
a.cc:25:33: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   25 |             ans=A[size-2]+A[size-3]-2;
      |                             ~~~~^~
Language: C++

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

using ll=long long;

map<ll,int> primeFact(ll n) {
  map<ll,int> r;
  for(ll i=2; i*i<=n; i++)
    while(n%i == 0) {
      r[i]++;
      n /= i;
    }
  if(n != 1)
    r[n] = 1;
  return r;
}

int main() {
    ll i,N,x;
    cin >> N;
    x = N;

    for(i=1; i*i<=N; i++) {
        if(N%i == 0)
            x = min(x, i+N/i)
    }

    cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:30: error: expected ';' before '}' token
   25 |             x = min(x, i+N/i)
      |                              ^
      |                              ;
   26 |     }
      |     ~
Language: C++

int main(void){
	long long n;
	cin >> n;

	int count=0;
	long long n_data[1000];
	for(int i=1;i<=n;i++){
		if(n%i == 0){
			n_data[count] = i;
			count+=1;
		}
	}

//	for(int i = 0;i < n;i++){
//		cout<<n_data[i];
//	}
//	cout<<endl;

	int ans_x;
	int ans_y;

	if(count % 2 == 0){
		ans_x = n_data[count/2 - 1];
		ans_y = n_data[count/2];

	}
	else{
		ans_x = n_data[count/2];
		ans_y = n_data[count/2];
	}

	cout<<"ans_x;"<< ans_x<<endl;
	cout<<"ans_y;"<< ans_y<<endl;

	int ans = (ans_x - 1) + (ans_y - 1);
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> n;
      |         ^~~
a.cc:32:9: error: 'cout' was not declared in this scope; did you mean 'count'?
   32 |         cout<<"ans_x;"<< ans_x<<endl;
      |         ^~~~
      |         count
a.cc:32:33: error: 'endl' was not declared in this scope
   32 |         cout<<"ans_x;"<< ans_x<<endl;
      |                                 ^~~~
Language: C++

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

typedef pair<long long,long long> P;

int main(){
    long long N; cin >> N;
    //static vector<unsigned long long> memo(1000000000000,-1);
    //array<array<long long,1000000>,1000000> memo;
    queue<P> q;

    q.push(P (1,1));
    while(q.size()){
        P p = q.front(); q.pop();

        //計算したことあるかの確認
        if(memo.at(p.first * p.second) != -1) continue;
        //cout << p.first << p.second << endl;

        if(p.first * p.second == N){
            long long ans = (p.first - 1) +  (p.second - 1);
            cout << ans << endl;
            break;
        }else if(p.first <= p.second){
            q.push(P (p.first + 1,1));
        }else{
            q.push(P (p.first,p.second + 1));
        };
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: 'memo' was not declared in this scope
   17 |         if(memo.at(p.first * p.second) != -1) continue;
      |            ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
ll syou[100];
int main() {
   ll i,j,k,rute;
    ll a=1,b=1,n,min=0,syounum=0;
    bool eta=true;

    cin >> n;
min=n+1;

syou[0]=n;
while(eta)
{

  for(i=2; i<syou[syounum]; i++)
  {

    if(syou[syounum]%i==0)
    {
      syou[syounum+1]=syou[syounum]/i;
     syounum+=1;
      break;
    }

    if(i=syou[syounum]-1)
    {
      eta=false;
    }

  }

}

for(i=0; i<pow(2,syounum); i++)
{
  for(j=1; j<=syounum; j++)
  {
    if(i%pow(2,j)==1)
    {
      a*=syou[j];
    }else
    {
      b*=syou[j];
    }
  }
if(min>a+b)
{
  min=a+b;
}
}


   
  cout <<  min-2<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: invalid operands of types 'll' {aka 'long long int'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   40 |     if(i%pow(2,j)==1)
      |        ~^~~~~~~~~
      |        |    |
      |        |    __gnu_cxx::__promote<double>::__type {aka double}
      |        ll {aka long long int}
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

ll num, mini;
vector<ll> ans(0);
vector<ll> prime_facts; //補足1

void factorize(ll n) {
	for (ll i = 2; i*i <= num; i++) { //補足2-1
		if (n%i != 0) continue;
		//pair<int, int> p(i, 0);
		//prime_facts.push_back(i);
		while (n%i == 0) {
			n /= i;
			prime_facts.push_back(i);
			//cout << i << endl;
		}
	}
	if (n != 1) prime_facts.push_back(n); //補足2-2
}

void getTurn() {

}

int main() {
	cin >> num;
	factorize(num);
	mini = num;
	/*
	for (int i = 0; i < prime_facts.size(); i++) {
		cout << prime_facts.at(i) << endl;
	}
	*/
	
	if (prime_facts.size() == 1) {
		mini = (prime_facts.at(0) - 1);
	}
	else {
		ll aa = 1;
		for (int i = 0; i < prime_facts.size(); i++) {
			aa *= prime_facts.at(i);
			//cout << aa << ' ' << num / aa << endl;
			ans.push_back(aa + num / aa);
			if (mini > aa + num / aa - 2) mini = aa + num / aa - 2;
			
		}
		sort(ans.begin(), ans.end());
		mini = ans.at(0) - 2;
	}
	
	cout << mini;

Compiler output:
a.cc: In function 'int main()':
a.cc:53:22: error: expected '}' at end of input
   53 |         cout << mini;
      |                      ^
a.cc:27:12: note: to match this '{'
   27 | int main() {
      |            ^
Language: Java

import java.util.Scanner;
public class demo3 {
	public static void main(String []args) {
		Scanner sc=new Scanner(System.in);
		long a=sc.nextLong();
		double m=Math.sqrt(a);
		int n;
		n=(int)m;
		for(int i=n;i>0;i--) {
			if(a%i==0) {
				System.out.println(i+a/i-2);
				break;
			}
		}
		
	}
}


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

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

using namespace std;

int main() {
  //変数の定義
  long long num, ans, x, y;
  int length;
  vector<int> vec;
  
  //入力を受け取る
  cin >> num;
  
  //約数をすべて求める
  for(long long i=1;i<=num/2;i++){ //num/2まででループを止める
    if(num%i==0){
     vec.push_back(i);
    }
  vec.push_back(num); //自身を最後に追加
  
  //約数の個数を求める
  length = vec.size();
  
  //約数の個数が奇数か偶数かで処理を分ける
  if(length%2==1){
    x = vec.at(length/2);
    ans = x+x-2;
  }
  else{
    x = vec.at(length/2);
    y = vec.at((length/2)-1);
    ans = x+y-2;
  }
  
  //出力
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: Java

import java.util.Scanner;
java.lang.Math

public class Main {
	public static void main(String[] args) throws Exception {
	Scanner sc = new Scanner(System.in);
	int N1 = sc.nextInt();
	int tmp = 0;
    int anstmpA = 0;
    int ans = 100000000000;      

	for(int i = 1;i<10;i++)	{
        tmp = N1 / i;
		if ((N1 % i == 0)) {
			for (int j = 1; j < 10; j++) {
				if ((tmp % j == 0 ) && ((tmp / j) == 1 )) {
                  ans = Math.min( anstmpA, i+ j)
                  anstmpA = i + j ;                  
				}
			}
		}
	}
	System.out.println(anstmpA);
    }
}


Compiler output:
Main.java:2: error: class, interface, enum, or record expected
java.lang.Math
^
Main.java:10: error: integer number too large
    int ans = 100000000000;      
              ^
Main.java:17: error: ';' expected
                  ans = Math.min( anstmpA, i+ j)
                                                ^
3 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N;
  int ans1  = 0;
  int ans2  = 0;
  int ans3  = 0;
  int ans4  = 0;
  int ans5  = 0;
  int ans6  = 0;
  cin >> N;
  for(int i=2;i<=1000000;i++){
    if(N % i == 0){
      ans1 = i;
      ans2 = N/i;
        break;
    }
  }
  for(int j=i+1	;j<=1000000;j++){
    if(N % j == 0){
      ans3 = j;
      ans4 = N/j;
        break;
    }
  }
  for(int k=j+1	;k<=1000000;k++){
    if(N % k == 0){
      ans5 = k;
      ans6 = N/k;
        break;
    }
  }
  if(N==4){
    ans1 =2;
    ans2 =2;
  }
  if(N==6){
    ans1 =2;
    ans2 =3; 
  }
  if(N==8){
    ans1 =2;
    ans2 =4; 
  }
  if(N==9){
    ans1 =3;
    ans2 =3; 
  }
  if(N==12){
    ans1 =2;
    ans2 =6;   
  }
  if(N==16){
    ans1 =4;
    ans2 =4;    
  }
  if(N==18){
    ans1 =3;
    ans2 =6;    
  }
  if(N==20){
    ans1 =4;
    ans2 =5;    
  }
  if(N==24){
    ans1 =4;
    ans2 =6;    
  }
  if(N==30){
    ans1 =5;
    ans2 =6;    
  }
  if(N==36){
    ans1 =6;
    ans2 =6;    
  }
  if(N==40){
    ans1 =5;
    ans2 =8;    
  }
  if ((ans1 + ans2) >= (ans3 + ans4) && (ans1 + ans2) >= (ans5 + ans6)){ 
      cout << ans1 + ans2 - 2;
  }else if ((ans3 + ans4) >= (ans1 + ans2) && (ans3 + ans4) >= (ans5 + ans6)){ 
      cout << ans3 + ans4 - 2;
  }else if ((ans5 + ans6) >= (ans3 + ans4) && (ans5 + ans6) >= (ans1 + ans2)){ 
      cout << ans5 + ans6 - 2;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'i' was not declared in this scope
   20 |   for(int j=i+1 ;j<=1000000;j++){
      |             ^
a.cc:27:13: error: 'j' was not declared in this scope
   27 |   for(int k=j+1 ;k<=1000000;k++){
      |             ^