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

#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;

#define REP(i,n) for (int i = 0; i < n; i++)

typedef long long ll;

int main ()
{
    
    ll N,M;
    cin >> N >> M;

    assert(N > 1);

    if (N == 1) {
        cout << M << endl;
        return 0;
    }

    ll ans = 1;
    for (ll i = 1; i * i <= M; i++) {
        if (M % i == 0) {
            if (M / i >= N) {
                ans = max(ans, i);
            }
        }
    }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: 'assert' was not declared in this scope
   33 |     assert(N > 1);
      |     ^~~~~~
a.cc:21:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   20 | #include <cstdlib>
  +++ |+#include <cassert>
   21 | using namespace std;
Language: C++

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

int main(){
  	ll n,m,memo = 0;
  	cin >> n >> m;
  
  	rep(i,1,sqrt(m)){
     	if(m % i == 0 && m/i >= n){
         	memo = max(memo,i);
          	if(i >= n){
              memo = max(memo,m/i);
            }
        }
    }
  
  	cout << memo << endl;
  
 	return 0; 
}

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

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

int main(){
	int N, M, lim;
	cin >> N >> M;
	lim = M/N;
	int num = 0;
	vector<int> yakusu;
	for(int i=0; i<sqrt(M); i++){
		if(M % (i+1) == 0){
			yakususmall[num] = i+1;
			num++;
			yakusularge[num] = M/(i+1);
			num++;
		}
	}
	int max = -1;
	for(int i=0; i<yakusu.size(); i++){
		if(yakusu[i] <= lim){
			if(max < yakusu[i]) max = yakusu[i];
		}
	}
	cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:25: error: 'yakususmall' was not declared in this scope
   12 |                         yakususmall[num] = i+1;
      |                         ^~~~~~~~~~~
a.cc:14:25: error: 'yakusularge' was not declared in this scope
   14 |                         yakusularge[num] = M/(i+1);
      |                         ^~~~~~~~~~~
Language: C++

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

int main(){
	int N, M, lim;
	cin >> N >> M;
	lim = M/N;
	int num = 0;
	vector<int> yakususmall;
	vector<int> yakusularge
	for(int i=0; i<sqrt(M); i++){
		if(M % (i+1) == 0){
			yakususmall[num] = i+1;
			yakusularge[num] = M/(i+1);
			num++;
		}
	}
	int Size1 = yakususmall.size();
	int Size2 = yakusularge.size();
	for(int i=0; i<Size2; i++){
		if(yakusularge[i] <= lim){
			cout << yakusularge[i] << endl;
			return 0;
		}
	}
	for(int i=Size1-1; i>=0; i--){
		if(yakususmall[i] <= lim){
			cout << yakususmall[i] << endl;
			return 0;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected initializer before 'for'
   11 |         for(int i=0; i<sqrt(M); i++){
      |         ^~~
a.cc:11:22: error: 'i' was not declared in this scope
   11 |         for(int i=0; i<sqrt(M); i++){
      |                      ^
a.cc:19:21: error: 'yakusularge' was not declared in this scope
   19 |         int Size2 = yakusularge.size();
      |                     ^~~~~~~~~~~
Language: C++

# include <bits/stdc++.h>
# include <iostream>
# include <vector>
# include <algorithm>

std::vector<long long int> dicisor(long long int n);

long long int main(){
    long long int N, M;
    scanf("%d%d", &N, &M);
    std::vector<long long int> ans = dicisor(M);
    for (long long int i = 0; i < ans.size(); i++){
        if(ans[i] >= N && i - 1 >= 0){
            prlong long intf("%d", ans[i - 1]);
            break;
        }
    }
    return 0;
}

std::vector<long long int> dicisor(long long int n){
    std::vector<long long int> ans;
    for (long long int i = 1; i < sqrt(n); i++){
        if(n % i == 0){
            ans.push_back(i);
            ans.push_back(n / i);
        }
    }
    std::sort(ans.begin(), ans.end());
    return ans;
}

Compiler output:
a.cc:8:11: error: '::main' must return 'int'
    8 | long long int main(){
      |           ^~~
a.cc: In function 'int main()':
a.cc:14:13: error: 'prlong' was not declared in this scope; did you mean 'ulong'?
   14 |             prlong long intf("%d", ans[i - 1]);
      |             ^~~~~~
      |             ulong
Language: C

#include<bits/stdc++.h>
using namespace std;
int m,n;
int gcd(int a,int b){
	return b==0?a:gcd(b,a%b);
}
int main(){
	scanf("%d%d",&m,&n);
	int c=n/m;
	int d=n-c*m;
	printf("%d",gcd(c,c+d));
}

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 n,m,roy,ans;
int xy(int a,int b);
int main()
{
	cin>>n>>m;
	roy=m/n;
	for(int i=roy;i>=1;i--)
	{
	ans+=xy(i,tmp);
	if(!(m%i))
		{
		cout<<i;
		return 0;
		}
	}
	cout<<ans;
	return 0;
}
int xy(int a,int b)
{
	a=a^b;
	b=b^a;
	b=b>>2;
	a=a<<2;
	a=(a^b)^(a&b)|(--a)&(--b)^(a|b);
	b=a^b;
	return b|a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   11 |         ans+=xy(i,tmp);
      |                   ^~~
      |                   tm
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<cmath>
unng namespace std;
int main()
{
	long long n,m,ans=0;
	scanf("%lld%lld",&n,&m);
	if(n>m)
	{
		cout<<"0"<<endl;
		return 0;
	}
	if(m%n==0)
	{
		cout<<m/n<<endl;
		return 0;
	}
	for(long long i=1;i<=m;i++)
	{
		if(m%i==0&&m/i>=n)
		ans=i;
		if(m/i<n) break;
	}
	printf("%lld",ans);
	return 0;
}

Compiler output:
a.cc:6:1: error: 'unng' does not name a type
    6 | unng namespace std;
      | ^~~~
a.cc: In function 'int main()':
a.cc:13:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |                 cout<<"0"<<endl;
      |                 ^~~~
      |                 std::cout
In file included from a.cc:4:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |                 cout<<"0"<<endl;
      |                            ^~~~
      |                            std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:18:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |                 cout<<m/n<<endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |                 cout<<m/n<<endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
int n,m,roy,ans;
int xy(int a,int b);
int main()
{
	cin>>n>>m;
	roy=m/n;
	for(int i=roy;i>=1;i--)
	{
	ans+=xy(i,tmp);
	if(!(m%i))
		{
		cout<<i;
		return 0;
		}
	}
	cout<<ans;
	return 0;
}
int xy(int a,int b)
{
	a=a^b;
	b=b^a;
	b=b>>2;
	a=a<<2;
	a=(a^b)^(a&b)|(--a)&(--b)^(a|b);
	b=a^b;
	return b|a;
}

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 <iostream>
#include <algorithm>

using namespace std;

#define ll long long

signed main()
{
    ll N, M;
    cin >> N >> M;

    vector<ll> d;

    for (int i = 1; i * i <= M; ++i) {
        if (M % i == 0) {
            d.push_back(i);
            if (M / i != i) {
                d.push_back(M / i);
            }
        }
    }

    sort(begin(d), end(d), greater<ll>());

    for (ll a : d) {
        if (a * N <= M) {
            cout << a << endl;
            return 0;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'vector' was not declared in this scope
   13 |     vector<ll> d;
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | 
a.cc:6:12: error: expected primary-expression before 'long'
    6 | #define ll long long
      |            ^~~~
a.cc:13:12: note: in expansion of macro 'll'
   13 |     vector<ll> d;
      |            ^~
a.cc:17:13: error: 'd' was not declared in this scope
   17 |             d.push_back(i);
      |             ^
a.cc:24:16: error: 'd' was not declared in this scope
   24 |     sort(begin(d), end(d), greater<ll>());
      |                ^
Language: C

#include <iostream>
using namespace std;
#define ll long long
signed main()
{
    ll N, M;
    cin >> N >> M;

    // a1~aN の最大公約数がd => a1~aNがすべてd*i(i:自然数)の形で表される
    for (ll i = M / N; i >= 2; --i) {
        if ((M - i * N) % i == 0) {
            cout << i << endl;
            return 0;
        }
    }

    cout << 1 << endl;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)
#define rrep(i,x) for(int i=(int)x-1;i>=0;--i)
#define rrep1(i,x) for(int i=(int)x;i>=1;--i)

using ll=long long;
using ld=long double;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int, int>;
using vpii=vector<pii>;

template<class T,class U>ostream&operator<<(ostream&os,const pair<T,U>p){os<<"("<<p.fst<<", "<<p.scd<<")";return os;}
template<class T>ostream&operator<<(ostream&os,const vector<T>v){rep(i,v.size()){if(i)os<<", ";os<<v[i];}return os;}
template<typename T>T&max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T&min(T&a,T&b){if(a < b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a < b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a > b){a=b;return true;}return false;}

constexpr int inf = 1e9;
constexpr ll linf = 3e18;
constexpr double eps = 1e-9;

signed main()
{
    ll N, M;
    cin >> N >> M;

    // a1~aN の最大公約数がd => a1~aNがすべてd*i(i:自然数)の形で表される
    for (ll i = M / N; i >= 2; --i) {
        if ((M - i * N) % i == 0) {
            cout << i << endl;
            return 0;
        }
    }

    cout << 1 << endl;
}


Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)
#define rrep(i,x) for(int i=(int)x-1;i>=0;--i)
#define rrep1(i,x) for(int i=(int)x;i>=1;--i)

using ll=long long;
using ld=long double;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int, int>;
using vpii=vector<pii>;

template<class T,class U>ostream&operator<<(ostream&os,const pair<T,U>p){os<<"("<<p.fst<<", "<<p.scd<<")";return os;}
template<class T>ostream&operator<<(ostream&os,const vector<T>v){rep(i,v.size()){if(i)os<<", ";os<<v[i];}return os;}
template<typename T>T&max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T&min(T&a,T&b){if(a < b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a < b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a > b){a=b;return true;}return false;}

constexpr int inf = 1e9;
constexpr ll linf = 3e18;
constexpr double eps = 1e-9;

signed main()
{
    ll N, M;
    cin >> N >> M;

    ll ans = 1;

    // a1~aN の最大公約数がd => a1~aNがすべてd*i(i:自然数)の形で表される
    for (ll i = 2; i <= M; ++i) {
            if (j * N > M) break;
            if ((M - j * N) % j == 0) ans = max(ans, j);
        }
    }

    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:17: error: 'j' was not declared in this scope
   60 |             if (j * N > M) break;
      |                 ^
a.cc:61:22: error: 'j' was not declared in this scope
   61 |             if ((M - j * N) % j == 0) ans = max(ans, j);
      |                      ^
a.cc: At global scope:
a.cc:65:5: error: 'cout' does not name a type
   65 |     cout << ans << endl;
      |     ^~~~
a.cc:66:1: error: expected declaration before '}' token
   66 | }
      | ^
Language: C++

#include<cstdio>
using namespace std;
long long n,m;
long long sol(long long n,long long m)
{
	long long i=sqrt(m);
	for(long long j=i+1;j>=1;j--)
	if(m%j==0)
	{
		if(m/j>=n) return j;
	}
}
int main(){
	cin>>n>>m;
	if(n==1) cout<<m<<endl;
	else
	cout<<sol(n,m)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'long long int sol(long long int, long long int)':
a.cc:6:21: error: 'sqrt' was not declared in this scope
    6 |         long long i=sqrt(m);
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:14:9: error: 'cin' was not declared in this scope
   14 |         cin>>n>>m;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cstdio>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:15:18: error: 'cout' was not declared in this scope
   15 |         if(n==1) cout<<m<<endl;
      |                  ^~~~
a.cc:15:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:27: error: 'endl' was not declared in this scope
   15 |         if(n==1) cout<<m<<endl;
      |                           ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<cstdio>
  +++ |+#include <ostream>
    2 | using namespace std;
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout<<sol(n,m)<<endl;
      |         ^~~~
a.cc:17:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:25: error: 'endl' was not declared in this scope
   17 |         cout<<sol(n,m)<<endl;
      |                         ^~~~
a.cc:17:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc: In function 'long long int sol(long long int, long long int)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^
Language: C

include <stdio.h>
#include <math.h>
int main()
{
    int n,m,i,g=1;
    scanf("%d%d",&n,&m);
    for(i=1; i<=n; i++)
    {
        if(m%i == 0)
        {
                g = i;
        }
            
    }
    printf("%d",g);
}


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:6:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |     scanf("%d%d",&n,&m);
      |     ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include <math.h>
  +++ |+#include <stdio.h>
    3 | int main()
main.c:6:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |     scanf("%d%d",&n,&m);
      |     ^~~~~
main.c:6:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:15:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 |     printf("%d",g);
      |     ^~~~~~
main.c:15:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#include <math.h>
int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    while(k<=sqrt(m))
    {
        if(m%n==0)
        {
            printf("%d",m/n);
            break;
        }
        else
            n++;
    }
}


Compiler output:
main.c: In function 'main':
main.c:7:11: error: 'k' undeclared (first use in this function)
    7 |     while(k<=sqrt(m))
      |           ^
main.c:7:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int a[100]={0},n,i,x;
        scanf("%d",&n);
        for(i=0;i<n;i++)
        {
            int ans=0;
            scanf("%d",&x);
            while(x>0)
            {
                x/=2;
                ans++;
            }
            a[ans]+=1;
        }
        int k=0;
        for(i=0;i<33;i++) if(a[i]>k) k=a[i];
        printf("%d\n",k);
    }
    return 0;
}

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

/*
  Code By RyeCatcher
*/
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cctype>
#include <vector>
#include <queue>
#include <utility>
#define ri register int
#define ll long long
#define ull unsigned long long
#define pb push_back
#define DEBUG freopen("dat.in","r",stdin);freopen("wa.out","w".stdout);
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define SIZE 23333
using std::min;
using std::max;
using std::pair;
using std::queue;
using std::priority_queue;
using std::vector;
inline char gc(){
    static char buf[SIZE],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,SIZE,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
template <class T>inline void read(T &x){
	x=0;int ne=0;char c;
    while((c=gc())>'9'||c<'0')ne=c=='-';x=c-48;
    while((c=gc())>='0'&&c<='9')x=(x<<3)+(x<<1)+c-48;x=ne?-x:x;return ;
}
int n,m;
int main(){
	read(n),read(m);
	for(ri i=min((int)sqrt(m+0.5),m/n);i>=1;i--){
		if(m%i==0){printf("%d\n",i);break;}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:27: error: 'sqrt' was not declared in this scope
   38 |         for(ri i=min((int)sqrt(m+0.5),m/n);i>=1;i--){
      |                           ^~~~
a.cc:38:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   38 |         for(ri i=min((int)sqrt(m+0.5),m/n);i>=1;i--){
      |                ^
Language: C++

#include <bits/stdc++.h
using namespace std;
typedef long long ll;
int main(){
    ll n,m,sol=1;
    cin >> n >> m;
    for(ll i = 1; i*i <= m; i++){
        if(m%i == 0){
           ll novo = m/i;
           if(n <= novo){
              sol = max(sol,i);
           }
           novo = i;
           if(n <= i){
              sol = max(sol,m/i);
           }
        }
    }
    cout << sol << endl;
}


Compiler output:
a.cc:1:24: error: missing terminating > character
    1 | #include <bits/stdc++.h
      |                        ^
Language: C++

#include <bits/stdc++.h
using namespace std;
typedef long long ll;
int main(){
    ll n,m,sol=1;
    cin >> n >> m;
    for(long i = 1; i*i <= m; i++){
        if(m%i == 0){
           ll novo = m/i;
           if(n <= novo){
              sol = max(sol,i);
           }
        }
    }
    cout << sol << endl;
}

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <fstream>
#include <queue>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <sstream>

#define For(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  For(i,0,n)

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
#define SORT(c) sort((c).begin(),(c).end())
#define vi(m,a) vector<int> m(a)
#define vti(m,a,i) vector<vector<int>> m(a,vector<int>(i))
#define ALL(it,a) for(auto it = a.begin(); it!=a.end(); it++)
#define Fe(it,a) for(auto &it : a)
#define all(a) begin(a),end(a)

using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
#define WARU 1000000007;

int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
void printhoge(set<int> v) {
	ALL(it, v) {
		cout << *it << " ";
	}
	cout << endl;

}

int main() {
	int m, n;
	cin >> n >> m;
	ll res = 1;
	int mm = m;
	while (mm > n) {
		int tmp = min(mm / n, int(sqrt(m)));
		int yakusu = 1;
		for (int i = tmp; i >= 2;i--) {
			if (mm % i == 0) {
				yakusu = i;
				break;
			}
		}
		if (yakusu == 1)
			break;
		res *= yakusu;
		mm /= tmp;
	}
	cout << res << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:51:43: error: 'sqrt' was not declared in this scope
   51 |                 int tmp = min(mm / n, int(sqrt(m)));
      |                                           ^~~~
Language: C++

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

using namespace std;


//xまでの素数を列挙O(n^1.5)
vector<int> get_prime_numbers(int x) {
	vector<int> v;
	int sn = sqrt(x);

	for (int number = 2; number <= x; number++) {
		int i = 0;
		bool pn = false;
		while (true) {
			if (i >= v.size() || v[i] > sn) { //平方根までの全素数で割れればOK
				v.push_back(number);
				break;
			}
			if (number % v[i] == 0) break;
			i++;
		}
	}
	return v;
}

//全ての約数リスト(素朴な全探索O(n))
vector<int> get_all_divisors(int x) {
	vector<int> v;
	for (int n = 1; n <= x; n++) {
		if (x % n == 0) v.push_back(n);
	}
	return v;
}

int main()
{
	int n, m;
	cin >> n >> m;

	vector<int> vd = get_all_divisors(m);
	for (int i = 0; i < vd.size(); i++) {
		if (vd[i] >= n) {
			int x = m / vd[i];
			cout << x;
			break;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'std::vector<int> get_prime_numbers(int)':
a.cc:12:18: error: 'sqrt' was not declared in this scope
   12 |         int sn = sqrt(x);
      |                  ^~~~
Language: Java

import java.util.*;

public class main {
	public static void main (String[] args){
     Scanner scan = new Scanner(System.in);
     
     int N = scan.nextInt();
     int M = scan.nextInt();
     
     
     int k = (int)M/N;
     
    
     int ans=1;
     
     for(int i=2;i<=k;i++){
    	 if(M%i==0){
    		 ans=i;
    	 }
     }	 
     System.out.println(ans);
}
}


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

public class main {
	public static void main (String[] args){
     Scanner scan = new Scanner(System.in);
     
     int N = scan.nextInt();
     int M = scan.nextInt();
     
     //int sqrtM = (int)Math.sqrt((double)M);
     int k = (int)M/N;
     
     //int base = Math.min(k,sqrtM);
     int ans=1;
     
     for(int i=2;i<=k;i++){
    	 if(M%i==0){
    		 ans=i;
    	 }
     }	 
     System.out.println(ans);
}
}


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

package Biginner112D;

import java.util.*;
 

public class main {
	public static void main (String[] args){
     Scanner scan = new Scanner(System.in);
     
     int N = scan.nextInt();
     int M = scan.nextInt();
     
     int sqrtM = (int)Math.sqrt((double)M);
     int k = (int)M/N;
     
     int base = Math.min(k,sqrtM);
     int ans=1;
     
     for(int i=2;i<=base;i++){
    	 if(M%i==0){
    		 ans=i;
    	 }
     }	 
     System.out.println(ans);
}
}



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

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

int main()
{
int n,m;
cin >>n>>m;
int maxx=0;
for(int i=1;i<=n;i++)
{
if(m%n==0)
{
if(m/n>=n)
{
maxx=n;
}
}
}
printf("%i\n",maxx);
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespade'
    2 | using namespade std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | cin >>n>>m;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: lvalue required as left operand of assignment
    8 |         for(int x=1;x*x=m;x++)
      |                     ~^~
Language: C

#include <stdio.h>
int main() {
	int n,m;
	scanf("%d%d",&n,&m);
	if (n == 1) {
		cout << m << endl;
		return 0;
	}
	for (int i = m/2; i; i--) {
		if (!(m%i) && m/i >= n) {
			printf("%d",i);
			return 0;
		}
	}
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:17: error: 'cout' undeclared (first use in this function)
    6 |                 cout << m << endl;
      |                 ^~~~
main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:30: error: 'endl' undeclared (first use in this function)
    6 |                 cout << m << endl;
      |                              ^~~~
Language: C++

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

long long N, X[1009], Y[1009], H[1009]; vector<tuple<long long, long long, long long>>vec;

int main() {
	cin >> N; tuple<long long, long long, long long>G = make_tuple(-1, -1, -1);
	for (int i = 1; i <= N; i++) {
		cin >> X[i] >> Y[i] >> H[i];
		if (H[i] >= 1) G = make_tuple(X[i], Y[i], H[i]);
	}
	for (int i = 0; i <= 100; i++) {
		for (int j = 0; j <= 100; j++) {
			long long V = get<2>(G) + abs(get<0>(G) - i) + abs(get<1>(G) - j); V = max(V, 0LL); bool flag = true;
			for (int k = 1; k <= N; k++) {
				long long VV = V - abs(X[k] - i) - abs(Y[k] - j); VV = max(VV, 0LL);
				if (H[k] != VV) flag = false;
			}
			if (flag == true) vec.push_back(make_tuple(i, j, V));
		}
	}
	if (vec.size() == 1) {
		cout << get<0>(vec[0]) << " " << get<1>(vec[0]) << " " << get<2>(vec[0]) << endl;
	}
	return 0;


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

n, m = map(int, raw_input().split())

yueshu = []
state = 0
for i in range(1, int(m**0.5)+1):
    if m % i == 0:
        yueshu.insert(0, m/i)
        if i >= n:
            print m / i
            state = 1
            break
if state == 0:
    for i in range(int(m**0.5)+1, m):
        if m % i == 0:
            if i >= n:
                print m / i
                break
if state == 0:
    print 1




Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, m = map(int, raw_input().split())
      | ^
Language: Java

import java.util.Scanner;

public class D {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		
	
		for(int i = b;i>0;i--) {
			if(b%i == 0) {
				if(b/i >= a) {
					System.out.println(i);
					return;
				}
			}
		}
	}
}

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

// D.

#include <sstream>
#include <iostream>
#include <algorithm>

using namespace std;

int main(int argc, char *argv[])
{
	int n, m, ans = 0;
	cin >> n >> m;
	int mm = sqrt(m);
	for (int i = 1; i <= mm; ++i) {
		int a = m / i;
		if (a * i == m) {
			if (a >= n) {
				ans = max(ans, i);
			}
			if (i >= n) {
				ans = max(ans, a);
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:13:18: error: 'sqrt' was not declared in this scope
   13 |         int mm = sqrt(m);
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main () {
  int N, M;
  cin >> N >> M;
  bool did = true;
  for (int i = 0; i < M/N, i ++) {
    int j = M/N - i;
    if (M % j == 0) {
      cout << j << endl;
      did = false;
    }
    if (!did) break;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:32: error: expected ';' before ')' token
    7 |   for (int i = 0; i < M/N, i ++) {
      |                                ^
      |                                ;
Language: C++

#include<iostream>
using namespace std;
int main(){
	int N,M;
	cin>>N>>M;
	int ans=1;
	for(int i=1;i<=sqrt(M);i++){
		if(M%i==0){
			if(M/i>=N)ans=max(ans,i);
			if(i>=N)ans=max(ans,M/i);
		}
	}
	cout<<ans<<endl;
}

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cstdint>
#include <map>
#include <cmath>

#include <boost/range/irange.hpp>
#include <boost/range/adaptor/filtered.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/algorithm/max_element.hpp>
 
using namespace std;
using boost::irange;
using boost::adaptors::filtered;
using boost::adaptors::transformed;

 
int main()
{
    int n, m;
    cin >> n >> m;
    
    cout << *boost::max_element( irange(1, (int)sqrt(m) + 1)
      | filtered([=](int i){ return i <= m/n && m % i == 0; })
      | transformed([=](int i){ return i >= n ? max(i, m/i) : i; }) ) << '\n';
    
    return 0;
}


Compiler output:
a.cc:9:10: fatal error: boost/range/irange.hpp: No such file or directory
    9 | #include <boost/range/irange.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cstdint>
#include <map>
#include <cmath>

#include <boost/range/irange.hpp>
#include <boost/range/adaptor/filtered.hpp>
#include <boost/range/algorithm/max_element.hpp>


using namespace std;
using boost::irange;
using boost::adaptors::filtered;

int main()
{
    int n, m;
    cin >> n >> m;
    
    const int limit = min(m/n, (int)sqrt(m)) + 1;
    
    cout << *boost::max_element(irange(1, limit) | filtered([=](int i){ return m % i == 0; })) << '\n';
    
    return 0;
}


Compiler output:
a.cc:9:10: fatal error: boost/range/irange.hpp: No such file or directory
    9 | #include <boost/range/irange.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<algorithm>
#include<string>
#include<vector>
#define ll long long
using namespace std;

//ans=Mの約数かつM/N以下
int main(){
	int N,M;
	cin >>M>>N;
	int ans=-1;
	for(int i=0;i*i<=M;i++){
		if(M%i==0 && i<=M/N){
			ans=i;
		}
	} 
	cout <<ans<<endl;
	return 0;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope
   10 |         cin >>M>>N;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<vector>
  +++ |+#include <iostream>
    4 | #define ll long long
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout <<ans<<endl;
      |         ^~~~
a.cc:17:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:21: error: 'endl' was not declared in this scope
   17 |         cout <<ans<<endl;
      |                     ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<vector>
  +++ |+#include <ostream>
    4 | #define ll long long
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();
long M = sc.nextLong();
long div=-1;
for(long i=1;i<=Math.floor(Math.pow(M,0.5));i++){
  if(M%i==0){
    ans=i;
  }
}


System.out.println(ans);
}
}


Compiler output:
Main.java:11: error: cannot find symbol
    ans=i;
    ^
  symbol:   variable ans
  location: class Main
Main.java:16: error: cannot find symbol
System.out.println(ans);
                   ^
  symbol:   variable ans
  location: class Main
2 errors
Language: C++

#include "pch.h"
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
vector<ll> making_list(ll m) {
	vector<ll> ret;
	for (int i = 1; i*i <= m; i++) {
		if (m%i == 0) {
			ret.push_back(i);

		}
		if (i*i != m) {
			ret.push_back(m / i);
		}

	}
	sort(begin(ret), end(ret));
	return ret;
}

int main() {
	int answer = 0;
	ll n, m;
	cin >> n >> m;
	vector<ll> ret = making_list(m);
	for (int i = 0; i*i < ret.size(); i++) {
		if (m >= n * ret[i]) {
		    answer = ret[i];
		}

	}
	cout << answer << endl;
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

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

typedef long long ll;
ll N, M;
int main(){
        scanf("%lld %lld",&N,&M);
        ll ans=1;
        std::vector<ll> q;

        for(ll i = 1; i*i <= M; i++){
                if(M % i == 0){
                        q.push_back(i);
                        q.push_back(M/i);
                }
        }
        std::sort(q.begin(),q.end());
        it = std::lower_bound(q.begin(),q.end(),N);
        printf("%lld\n",M/(*it));
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'it' was not declared in this scope; did you mean 'int'?
   19 |         it = std::lower_bound(q.begin(),q.end(),N);
      |         ^~
      |         int
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
ll n, m;
vector<ll> yaku;
int main(void){
    // Your code here!
    cin >> n >> m;
    for (ll i = 1; i <= sqrt(m); i++){
        if (m % i) continue;
        if (i >= n) yaku.push_back(i);
        if (m / i >= n) yaku.push_back(m / i);
    }
    sort(yaku.begin(), yaku.end());
    cout << m / yaku[0] << endl;
}


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

#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <utility>
#include <string>
#include <cmath>
#include <set>
#include <functional>
#include <map>
#include <queue>
#include <stack>
#include <iomanip>
#include <climits>
#include <unordered_map>
#include <numeric>
#include <cstring>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; ++i)
#define show(x) cout << #x << " = " << x << endl;
typedef long long ll;
typedef pair<int,int> pii;
#define int long long
int main(){
    int n,m;
    cin >> n >> m;
    vector<int>a;
    for(int i = 2; i*i<=m; i++){
        if(m%i==0){
            a.push_back(i);
            if(i*i!=m)a.push_back(m/i);
        }
    }
    sort(a.rbegin(),a.rend());
    for(int x:a){
        if(x*n<=m){
            cout << x << endl;
            return 0;
        }
    }
    cout << 1 << endl;
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: Java

import java.util.Scanner;
import java.util.Arrays;
public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        long N = sc.nextLong();
        long M = sc.nextLong();
        long L =M/N;
        long ans=1;
         for(long i=L;i>1;i--){
             if(M%i==0){
                 ans =Math.max(i,ans);
             }
         }
        System.out.println(ans);
    }

Compiler output:
Main.java:16: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    int ans = -1;
    for (int i = (int)1e9; i >= 0; i--) {
        if ((m - i) >= 0 && ((m - i) % n) == 0 && (m - i) / n != 0){
            ans = max(ans, __gcd(i, (m - i) / n));
            //cout << "TRY THIS:" << i << ' ' << (m - i) / n << ' ' << " ANS:" << ans << endl;
        }
        if ()
    }
     cout <<  ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected primary-expression before ')' token
   14 |         if ()
      |             ^
a.cc:15:5: error: expected primary-expression before '}' token
   15 |     }
      |     ^
Language: C++

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
unordered_map<int,bool> SO;
int main(){
    int n,m;
    cin >> n >> m;
    for(int i=n;i<=sqrt(m);i++){
        else if(m%i==0){
            cout << m/i << endl;
            return 0;
        }
    }
    cout << 1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'else' without a previous 'if'
   31 |         else if(m%i==0){
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using int64 = long long;

vector< int64 > divisor(int64 n)
{
    vector< int64 > ret;
    for(int64 i = 1; i * i <= n; i++) {
        if(n % i == 0) {
            ret.push_back(i);
            if(i * i != n) ret.push_back(n / i);
        }
    }
    sort(begin(ret), end(ret));
    return(ret);
}

int main(){
    int N, M;
    cin >> N >> M;
    auto divisors = divisor(M);
    for(int i = 0; i < divisors.size(); i++){
//    	cout << divisors[i] << endl;
        if(M / divisors[i] < N){
            cout << divisors[i - 1] << endl;
            return 0;
        }
    }
    cout << M << endl;
}


Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector< int64 > divisor(int64 n)
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:19:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   19 |     cin >> N >> M;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:21: error: 'divisor' was not declared in this scope; did you mean 'divisors'?
   20 |     auto divisors = divisor(M);
      |                     ^~~~~~~
      |                     divisors
a.cc:24:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |             cout << divisors[i - 1] << endl;
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:24:40: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   24 |             cout << divisors[i - 1] << endl;
      |                                        ^~~~
      |                                        std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:28:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   28 |     cout << M << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:28:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   28 |     cout << M << endl;
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

int main(){
  int n, m, i;
  std::cin >> n >> m;
  i = n;
  while(m % i != 0) i++;
    if(i > m / 2) {
      i = m;
      break;
    }
  std::cout << m / i << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: break statement not within loop or switch
   10 |       break;
      |       ^~~~~