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

#include<iostream>
#include<stdio.h>
using namespace std;
long long N;
int main()
{
	while (scanf_s("%lld", &N) != EOF)
	{
		long long  h, n, t1, t2;
		bool flag = 0;
		for (h = 1; h <= 3500; h++) 
		{
			for (n = 1; n <= 3500; n++)
			{
				t1 = N*h*n;
				t2 = 4 * h*n - n*N - h*N;
				if (t1 > 0 && t2 > 0 && t1%t2 == 0)
				{
					printf("%lld %lld %lld\n", h, n, t1 / t2);
					flag = 1;
					break;
				}
			}
			if (flag)
				break;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    7 |         while (scanf_s("%lld", &N) != EOF)
      |                ^~~~~~~
      |                scanf
Language: C

#include<stdio.h>
long long N,n1,n2;
int main()
{
	int h, n;
	scanf("%lld", &N);
	for (h = 1; h <= 3500; h++)
	{
		for ( n = 1; n <= 3500; n++)
		{
			n1 = N*h*n;
			n2 = 4 * h*n - n*N - h*N;
			if (n1%n2 == 0&&n1>0&&n2>0)
			{
				printf("%d %d %lld\n", n, h, n1/n2);
				k = 1;
				exit(0);			}
		}
			}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:33: error: 'k' undeclared (first use in this function)
   16 |                                 k = 1;
      |                                 ^
main.c:16:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:33: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   17 |                                 exit(0);                        }
      |                                 ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | long long N,n1,n2;
main.c:17:33: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   17 |                                 exit(0);                        }
      |                                 ^~~~
main.c:17:33: note: include '<stdlib.h>' or provide a declaration of 'exit'
Language: C

#include<stdio.h>
int main()
{
    long long h,a,b,n,N;
    int c;
    while(~scanf("%lld",&N))
    {
        c=0;
        for(h=1; h<=3500; h++)
        {
            for(n=1; n<=3500; n++)
            {
                a=N*h*n;
                b=4*h*n-N*n-h*N;
                printf("%lld %lld %lld\n",h,n,a/b);
                c++;
                break;
            }
        }
        if(c!=0) break;
    }
}
return 0;
}


Compiler output:
main.c:23:1: error: expected identifier or '(' before 'return'
   23 | return 0;
      | ^~~~~~
main.c:24:1: error: expected identifier or '(' before '}' token
   24 | }
      | ^
Language: C

#include<stdio.h>
int main()
{
    int i,j,N,o=0;
    double h,w,n;
    while(~scanf("%d",&N))
    {
        for(i=1; i<=3500; i++)
        {
            for(j=1; j<=3500; j++)
            {
                h=i;
                w=j;
                n=N*h*w/(4*h*w-N*w-N*h);
                if(int(n)==n&&n>0&&j>0&&i>0)
                {
                    if(4*h*w*n==N*(w*n+h*w+n*h))
                    {
                        o++;
                        printf("%.f %.f %.f\n",h,w,n);
                    }

                }
                if(o==1)
                    break;

            }
            if(o==1)
            {
                o=0;
                break;
            }
        }
    }
}


Compiler output:
main.c: In function 'main':
main.c:15:20: error: expected expression before 'int'
   15 |                 if(int(n)==n&&n>0&&j>0&&i>0)
      |                    ^~~
Language: C

#include<stdio.h>
int main()
{
    int i,j,N,o=0;
    double h,w,n;
    while(~scanf("%d",&N))
    {
        for(i=1; i<=3500; i++)
        {
            for(j=1; j<=3500; j++)
            {
                h=i;
                w=j;
                n=N*h*w/(4*h*w-N*w-N*h);
                if(int(n)==n&&n>0&&j>0&&i>0)
                {
                    if(4*h*w*n==N*(w*n+h*w+n*h))
                    {
                        o++;
                        printf("%.f %.f %.f\n",h,w,n);
                    }

                }
                if(o==1)
                    break;

            }
            if(o==1)
            {
                o=0;
                break;
            }
        }
    }
}

Compiler output:
main.c: In function 'main':
main.c:15:20: error: expected expression before 'int'
   15 |                 if(int(n)==n&&n>0&&j>0&&i>0)
      |                    ^~~
Language: C++

#include <iostream> 
using namespace std; 
int main(){
long long int a,b,c,m;
cin>>m;
for(int i=1;i<3501;i++){
for(int j=1;j<3501;j++){
a=m*i*j;
b=4*i*j-m(i+j);
if(a%b==0&&a/b>0){
cout<<i<<j<<a/b<<endl;
return 0;
}
}
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'm' cannot be used as a function
    9 | b=4*i*j-m(i+j);
      |         ~^~~~~
Language: C

#include <cstdio>
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
 
using namespace std;
 
int gcd(int u, int v) {
int r;
while (0 != v) {
r = u % v; u = v; v = r;
}
return u;
}
 
map<pair<int,int>,int>x;

 
int main(void) {
 
	int N;
 
	scanf("%d",&N);
	
	int a,b,c;
 
	for(c=1;c<=3500;c++){
		if((4*c)-N>0){
		int div=gcd(N*c,(4*c)-N);
		x[make_pair(((4*c)-N)/div,(N*c)/div)]=c;
		}
	}
 
	for(a=1;a<=3500;a++){
		for(b=3*N/4;b<=3500;b++){
			int div=gcd(a+b,a*b);
			if(x[make_pair((a+b)/div,(a*b)/div)]>0){
				printf("%d %d %d\n",a,b,x[make_pair((a+b)/div,(a*b)/div)]);
				return 0;
			}
		}
	}
 
	return 0;
}

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

#include <stdio.h>
#define int long long int
#define %d %lld
int main() {
	int m, n, w, p, q;
	scanf("%d", &m);
	for (w = 1; w <= 3500; w+=m)
	{
		for (n = 1; n <= 3500; n++)
		{
			p = m*n*w;
			q = 4 * n*w - m*w - m*n;
			if (q > 0 && p % q == 0)
			{
				printf("%d %d %d", p / q, n, w);
				return 0;
			}
		}
	}
}

Compiler output:
main.c:3:9: error: macro names must be identifiers
    3 | #define %d %lld
      |         ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
	double N, i, j, k;

	cin >> N;

	for (i = 1.0; i <= 3500.0; i += 1.0) {
		for (j = 1.0; j <= 3500.0; j += 1.0) {
			if (4 * i * j - N * i - N * j >= 1.0) {
				k = (N * i * j) / (4 * i * j - N * i - N * j);
				if (ceil(k) == floor(k)) {
					cout << int(i) << ' ' << int(j) << ' ' << int(k) << endl;
					return 0;
				}
			}
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: 'ceil' was not declared in this scope
   15 |                                 if (ceil(k) == floor(k)) {
      |                                     ^~~~
a.cc:15:48: error: 'floor' was not declared in this scope
   15 |                                 if (ceil(k) == floor(k)) {
      |                                                ^~~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rep(i,n) for(int i=0; i<n; i++)
#define FOR(i,a,n) for(int i=a; i<n; i++)

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

ll N;

int main()
{	
	cin >> N;

	FOR(h, 1, 3501) {
		FOR(n, 1, 3501) {
			ll a = N*h*n;
			ll b = 4LL * h * n - N*n - N*h;
			if (b == 0)continue;
			if (a % b != 0)continue;
			ll w = a / b;
			if (0 < w && w <= 3500) {
				printf("%lld %lld %lld\n",h,n,w);
				return;
			}
		}
	}
	return	0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:43:33: error: return-statement with no value, in function returning 'int' [-fpermissive]
   43 |                                 return;
      |                                 ^~~~~~
Language: Java

import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int N = Integer.parseInt(in.next());
		boolean breakFlag = false;
	　　　　int h,n,w;
		h=1;
		n=1;
		w=1;
//		for (h = 1; h <= 3500; h++){
			for (n = 1; n <= 3500; n++){
				for (w = 1; w <= 3500; w++){
					if(4*n*w>N*(n+w))h=N*n*w/(4*n*w-N*(n+w));
					if(4*h*n*w==N*(h*n+n*w+w*h)){
						breakFlag = true;
					}
					if(breakFlag)break;
				}if(breakFlag)break;
			}/*if(breakFlag)break;
		}*/
		System.out.println((int)h+" "+(int)n+" "+(int)w);
	}
}

Compiler output:
Main.java:7: error: illegal character: '\u3000'
	????int h,n,w;
	^
Main.java:7: error: illegal character: '\u3000'
	????int h,n,w;
	 ^
Main.java:7: error: illegal character: '\u3000'
	????int h,n,w;
	  ^
Main.java:7: error: illegal character: '\u3000'
	????int h,n,w;
	   ^
4 errors
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		if(N%2 == 0){
			System.out.println(N/2 + " " + N + " " + N);
		} else {
		outer:{for(int n = 1; n <= 3500; n++){
				for(int h = 1; h <= 3500; h++){
					if(n*h*N%(4*n*h-n*N-h*N) == 0){
				　　　　System.out.println(n + " " + h + " " + n*h*N/(4*n*h-n*N-h*N));
						break outer;
					}
				}
		}
			}
		}
    }
}

Compiler output:
Main.java:13: error: illegal character: '\u3000'
				????System.out.println(n + " " + h + " " + n*h*N/(4*n*h-n*N-h*N));
				^
Main.java:13: error: illegal character: '\u3000'
				????System.out.println(n + " " + h + " " + n*h*N/(4*n*h-n*N-h*N));
				 ^
Main.java:13: error: illegal character: '\u3000'
				????System.out.println(n + " " + h + " " + n*h*N/(4*n*h-n*N-h*N));
				  ^
Main.java:13: error: illegal character: '\u3000'
				????System.out.println(n + " " + h + " " + n*h*N/(4*n*h-n*N-h*N));
				   ^
4 errors
Language: C

#include <stdio.h>


int main (void){
    long long p,n,h,w;
    int a = 0;
    scanf("%lld",&p);
    for(n=1;1;n++){
        for(h=1;n<=h;h++){
            w = (4*h*n-p*n-p*n) / (p*h*n);
            if(w ＜ 0){
                a++;
                break;
            }
        }
        if(a == 1){
            break;
        }
    }
    
    printf("%lld %lld %lld\n",h,n,w);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: expected ')' before '\U0000ff1c'
   11 |             if(w ＜ 0){
      |               ~ ^~~
      |                 )
Language: C

#include <stdio.h>


int main (void){
    long long p,n,h,w;
    int a = 0;
    scanf("%lld",&p);
    for(n=1;1;n++){
        for(h=1;n<=h;h++){
            w = (4*h*n-p*n-p*n) / (p*h*n);
            if(w ！＝ 0){
                a++;
                break;
            }
        }
        if(a == 1){
            break;
        }
    }
    
    printf("%lld %lld %lld\n",h,n,w);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: expected ')' before '\U0000ff01\U0000ff1d'
   11 |             if(w ！＝ 0){
      |               ~ ^~~~~
      |                 )
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#define rep(i, n) for (int i = 1; i <= n; i++)
using namespace std;
long long N;
int main(){
  scanf("%d", &N);

  int n, h
  long long w;
/*  if (N % 2 == 0) {
    h = N / 2;
    n = N;
    w = N;
    printf("%d %d %d\n", h, n, w);
  }else {*/
    rep(h, 3500) {
      rep(n, 3500) {
        if (4 * n * h - N * n - N * h != 0){
          w = N * n * h / (4 * n * h - N * n - N * h);
          if (w > 0 && (N * n * h) % (4 * n * h - N * n - N * h) == 0) {
            printf("%d %d %d\n", h, n, w);
            return 0;
          }
        }
      }

  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected initializer before 'long'
   10 |   long long w;
      |   ^~~~
a.cc:20:11: error: 'w' was not declared in this scope
   20 |           w = N * n * h / (4 * n * h - N * n - N * h);
      |           ^
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
	int n;
	scanf("%d",&n);
	for(long long x=1;x<=3500;x++){
		for(long long y=1;y<=3500;y++){
			if((4*x*y-n*y-n*x)<=0) continue;
			if((n*x*y)%(4*x*y-n*y-n*x)==0){
				printf("%lld %lld %lld\n",x,y,(n*x*y)/(4*x*y-n*y-n*x))
				return 0;
			} 
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:87: error: expected ';' before 'return'
   13 |                                 printf("%lld %lld %lld\n",x,y,(n*x*y)/(4*x*y-n*y-n*x))
      |                                                                                       ^
      |                                                                                       ;
   14 |                                 return 0;
      |                                 ~~~~~~
Language: C++

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

int N;
int main(){
  scanf("%d", &N);

  int n, h, w;
/*  if (N % 2 == 0) {
    h = N / 2;
    n = N;
    w = N;
    printf("%d %d %d\n", h, n, w);
  }else {*/
    rep(h, 3500) {
      rep(n, 3500) {
        if (4 * n * h - N * n - N * h != 0){
          w = N * n * h / (4 * n * h - N * n - N * h);
          if (w > 0 && (N * n * h) % (4 * n * h - N * n - N * h) == 0) {
            printf("%d %d %d\n", h, n, w);
            return 0;
          }
        }
      }
    }
  }
  return 0;
}


Compiler output:
a.cc:29:3: error: expected unqualified-id before 'return'
   29 |   return 0;
      |   ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
	int n;
	cin>>n;
	for(int x=1;x<=3500;x++){
		for(int y=1;y<=3500;y++){
			if((4*x*y-n*y-n*x)<=0) continue;
			if((n*x*y)%(4*x*y-n*y-n*x)==0&&){
				cout<<x<<" "<<y<<" "<<(n*x*y)/(4*x*y-n*y-n*x)<<endl;
				return 0;
			} 
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:56: error: expected primary-expression before ')' token
   11 |                         if((n*x*y)%(4*x*y-n*y-n*x)==0&&){
      |                                                        ^
Language: Java

import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int N = cin.nextInt();
        int[] A = new int[N];
        int[] B = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = cin.nextInt();
            B[i] = cin.nextInt();
        }
        long answ = 100000000000;
        for (int i = 0; i < N; i++) {
            answ = Math.min(A[i] + B[i],answ);
        }
        System.out.println(answ);
 
    }
}

Compiler output:
Main.java:14: error: integer number too large
        long answ = 100000000000;
                    ^
1 error
Language: C++

#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define in insert
#define er erase
#define fr first
#define sc second
typedef long long ll;
const long long llinf=LLONG_MAX;
const int inf=INT_MAX;
const int nmax=1e5+5;
const int mod=1e9+7;
using namespace std;
int m;
ll n,w,h,ans,anss;
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
	scanf("%d", &m);
    for(ll h=1; h<=3500; h++)
        {
            for(ll n=1; n<=3500; n++)
                {
                    ans= m*h*n;
                    anss= n*h*4 - m*(n+h);
                    if(ans2 <= 0) continue;
                    if(ans%anss==0) printf("%ll %ll %ll",h,' ',n,' ',anss/ans);

                }
        }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:24: error: 'ans2' was not declared in this scope; did you mean 'anss'?
   27 |                     if(ans2 <= 0) continue;
      |                        ^~~~
      |                        anss
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>
#include <random>

using namespace std;

typedef vector<int> VI;
typedef pair<int, int> P;
typedef long long ll;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define ALL(a)  (a).begin(),(a).end()
#define UNIQUE(a)  (a).erase(unique((a).begin(),(a).end()),(a).end())
#define MP make_pair
#define PB push_buck
#define EACH(i,c) REP(i,(c).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,b,a) for(int i=(b)-1;i>=(a);--i)
#define RREP(i,n) RFOR(i,n,0)

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << "[L " << __LINE__ << "] " << #x << " = " << (x) << "\n";

const int INF = 1e9;
const double EPS = 1e-10;

int n, m, k, s, t;
VI es;
string str;

int main() {
	cin >> n;

	FOR(j, 1, 3501){
		FOR(l, 1, 3501){
		if((ll)4*j*l == ((ll)n*j+j*l+l*n)){
			cout<<n<<" "<<j<<" "<<l <<  endl;
			return 0;
		}
	}
}


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

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>
#include <random>

using namespace std;

typedef vector<int> VI;
typedef pair<int, int> P;
typedef long long ll;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define ALL(a)  (a).begin(),(a).end()
#define UNIQUE(a)  (a).erase(unique((a).begin(),(a).end()),(a).end())
#define MP make_pair
#define PB push_buck
#define EACH(i,c) REP(i,(c).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,b,a) for(int i=(b)-1;i>=(a);--i)
#define RREP(i,n) RFOR(i,n,0)

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << "[L " << __LINE__ << "] " << #x << " = " << (x) << "\n";

const int INF = 1e9;
const double EPS = 1e-10;

int n, m, k, s, t;
VI es;
string str;

int main() {
	cin >> n;
	int f = n/gcd(4,n);

	FOR(j, 1, 3501){
		FOR(l, 1, 3501){
		if((ll)4*j*l == ((ll)n*j+j*l+l*n)){
			cout<<n<<" "<<j<<" "<<l <<  endl;
			return 0;
		}
	}
}


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

#include<iostream>
using namespace std;
int main() {
	int N,h,n,w,x;
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N;
	x = (double)N/4
	h = (int)x+1;
	x -= 1/h;
	n = (int)x+1;
	x -= 1/n;
	w = (int)x+1;
	cout << h << " " << n << " " << w << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before 'h'
    8 |         x = (double)N/4
      |                        ^
      |                        ;
    9 |         h = (int)x+1;
      |         ~
Language: C++

#include<iostream>
using namespace std;
int main(){
int N,h,n;
double w;
cin>>N;

for(h=1;h<3051;h++){
for(n=h;n<3501;n++){
if (4*h*n == N*n + N*h){continue;}
w = N*h*n / (4*h*n - N*n - N*h);
if( (w<1) or (w>3500) or (int(w) != w) ){continue;}
cout<<n<<" "<<h<<" "<<longlong(N*h*n / (4*h*n - N*n - N*h));
return 0;
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: 'longlong' was not declared in this scope
   13 | cout<<n<<" "<<h<<" "<<longlong(N*h*n / (4*h*n - N*n - N*h));
      |                       ^~~~~~~~
Language: C++

//============================================================================
// Name        : CODEFESTIVAL2017qualA.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <algorithm>

using namespace std;

inline int main1();
inline int main2();
inline int main3();
inline int main4();

int main() {

	main4();

	return 0;
}

inline int main2() {

	int i, j, k;
	int num;
	int a, b;
	long long int max_a, min_b;

	max_a = 0;
	min_b = 1000000000;

	cin >> num;

	for (i = 0; i < num; i++) {
		cin >> a >> b;
		if (max_a < a) {
			max_a = a;
			min_b = b;
		}

	}

	cout << max_a + min_b;

	return 0;

}

inline int main3() {

	long long int i, j, k;
	long long int num;

	cin >> num;

	for (i = 1; i < 3501; ++i)
		for (j = 1; j < 3501; ++j)
			for (k = 1; k < 3501; ++k)
				if (0 ==(4 * i * j * k) - (num * (i * j + j * k + k * i))) {
					cout << i << " " << j << " " << k;
					return 0;
				}
	return 0;

}

Compiler output:
a.cc:23:12: warning: inline function 'int main4()' used but never defined
   23 | inline int main4();
      |            ^~~~~
/usr/bin/ld: /tmp/cc5xf9D1.o: in function `main':
a.cc:(.text+0x5): undefined reference to `main4()'
collect2: error: ld returned 1 exit status
Language: C++

include<iostream>
using namespace std;

int main(){
 long h,n,w,_n;
 cin>> _n;
 long const N=_n;
 for(h=1;h<=3501;h++){
    for(n=h;n<3501;n+=h){
      for(w=n;w<=3501;w+=h){
        if(4*h*n*w==N*(n*h+h*w+w*n)){
          cout<<h<<' '<<n<<' '<<w<<endl;
          h=n=w=100000;
        }
      }
    }
  }
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:2: error: 'cin' was not declared in this scope
    6 |  cin>> _n;
      |  ^~~
a.cc:12:11: error: 'cout' was not declared in this scope
   12 |           cout<<h<<' '<<n<<' '<<w<<endl;
      |           ^~~~
a.cc:12:36: error: 'endl' was not declared in this scope
   12 |           cout<<h<<' '<<n<<' '<<w<<endl;
      |                                    ^~~~
Language: Java

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double baseN = 4 / Integer.valueOf(sc.nextLine());

        long h = (long)Math.floor(3 / baseN);
        long n = (long)Math.floor((2 * h) / (h * baseN - 1));
        long w = (long)(1 / (baseN - 1/h - 1/n));

        while (true) {
            if (n <= 0) {
                h -= 1;
                n = (int)Math.floor((2 * h) / (h * baseN - 1));
                continue;
            }
            else if (w <= 0) {
                if (n == 1) {
                    h -= 1;
                    n = (long)Math.floor((2 * h) / (h * baseN - 1));
                    w = (long)(1 / (baseN - 1/h - 1/n));
                    continue;
                }
                else {
                    n -= 1;
                    w = (long)(1 / (baseN - 1/h - 1/n));
                    continue;
                }
            }
            break;
        }

        System.out.println(h + " " + n + " " + w);
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner stdin = new Scanner(System.in);
		int N;
		boolean b = false;
		N = stdin.nextInt();
		if(N<1200){
		for (int i = 1; i <= 3500; i++) {
			for (int j = 1; j <= i; j++) {
				for (int k = 1; k <= j; k++) {
					if (4 * i * j * k == N * i * j + N * j * k + N * k * i) {
						System.out.println(i + " " + j + " " + k);
						b = true;
					}
					if (b)
						break;
				}
				if (b)
					break;
			}
			if (b)
				break;
		}
		}else if(N>2300){
			for (int i = 3500; i >= 0; i--) {
				for (int j = 3500; j >= i; j--) {
					for (int k = 3500; k >= j; k--) {
						if (4 * i * j * k == N * i * j + N * j * k + N * k * i) {
							System.out.println(i + " " + j + " " + k);
							b = true;
						}
						if (b)
							break;
					}
					if (b)
						break;
				}
				if (b)
					break;
			}
		}else {
			for (int i = 1; i <= 3500; i++) {
				for (int j = 3500; j >= i; j--) {
					for (int k = 1; k <= j; k++) {
						if (4 * i * j * k == N * i * j + N * j * k + N * k * i) {
							System.out.println(i + " " + j + " " + k);
							b = true;
						}
						if (b)
							break;
					}
					if (b)
						break;
				}
				if (b)
					break;
			}
			
			
		}

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

#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    if (n % 2 == 0){
        cout << n << " " << n << " " << n / 2 << endl;
    }
    else {
        int x = 2;
        long long a = n;
        while (__gcd(x, a) != x){
            a *= 2;
            x *= 2;
            x += 2;
        }
        cout << a << " " << a << " " << 2 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: no matching function for call to '__gcd(int&, long long int&)'
   17 |         while (__gcd(x, a) != x){
      |                ~~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:17:21: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('int' and 'long long int')
   17 |         while (__gcd(x, a) != x){
      |                ~~~~~^~~~~~
Language: C++

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

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

	for (int h = 1; h <= 3500; h++) {
		for (int n = h; n <= 3500; n++) {
			if (0 < N*h*n / (4 * h*n - N*n - N*h) <= 3500 && ceil(N*h*n / (4 * h*n - N*n - N*h)) == floor(N*h*n / (4 * h*n - N*n - N*h))) {
				cout << h << " " << n << " " << N*h*n / (4 * h*n - N*n - N*h) << endl;
				break;
			}
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:74: error: 'ceil' was not declared in this scope
   13 |                         if (0 < N*h*n / (4 * h*n - N*n - N*h) <= 3500 && ceil(N*h*n / (4 * h*n - N*n - N*h)) == floor(N*h*n / (4 * h*n - N*n - N*h))) {
      |                                                                          ^~~~
a.cc:13:113: error: 'floor' was not declared in this scope
   13 |                         if (0 < N*h*n / (4 * h*n - N*n - N*h) <= 3500 && ceil(N*h*n / (4 * h*n - N*n - N*h)) == floor(N*h*n / (4 * h*n - N*n - N*h))) {
      |                                                                                                                 ^~~~~
Language: C++

#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    if (n % 2 == 0){
        cout << n << " " << n << " " << n / 2 << endl;
        return 0;
    }
    else {
        int x = 2;
        long long a = n;
        while (__gcd(x, a) != x){
            a *= 2;
            x *= 2;
            x += 2;
        }
        cout << a << " " << a << " " << 2 << endl;
        return 0;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:21: error: no matching function for call to '__gcd(int&, long long int&)'
   18 |         while (__gcd(x, a) != x){
      |                ~~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:18:21: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('int' and 'long long int')
   18 |         while (__gcd(x, a) != x){
      |                ~~~~~^~~~~~
Language: Java

import java.util.Scanner;

public class C {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextInt();
		long h = 0;
		long n = 0;
		long w = 0;
		if(N % 2 == 0) {
			h = N;
			n = N;
			w = N / 2;
		} else if(N % 3 == 0) {
			h = N / 3;
			n = N*2;
			w = N*2;
		}
		System.out.println(h+" "+n+" "+w);
	}
}

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

#include<iostream>
using namespace std;
int main(){
	double N;
	cin>>N;
	if(N%4==0)cout<<N<<" "<<N<<" "<<N/2<<endl;
	if(N%4==1)cout<<1<<" "<<N/2<<" "<<N/2<<endl;
	if(N%4==2)cout<<1<<" "<<1<<" "<<N/4<<endl;
	//if(N%4==3)cout<<1<<" "<<N/2<<" "<<N/2<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    6 |         if(N%4==0)cout<<N<<" "<<N<<" "<<N/2<<endl;
      |            ~^~
      |            | |
      |            | int
      |            double
a.cc:7:13: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    7 |         if(N%4==1)cout<<1<<" "<<N/2<<" "<<N/2<<endl;
      |            ~^~
      |            | |
      |            | int
      |            double
a.cc:8:13: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    8 |         if(N%4==2)cout<<1<<" "<<1<<" "<<N/4<<endl;
      |            ~^~
      |            | |
      |            | int
      |            double
Language: C++

#include <cstdio>
#define MAXNUM 100000

using namespace std;

int main(void)
{
    int N;
    scanf("%d", &N);
    int h, n, w;
    int L = (double) 4 / N;
    bool flag = false;
    if(N % 2 == 0)
    {
        printf("%d %d %d\n", N, N, N/2);
    } 
    else
    {
        /*
        for(h=1;h<MAXNUM;h++)
        {
            for(n=1;n<MAXNUM;n++)
            {
                if((n*h) % N == 0)
                {
                    int a = n * h / N;
                    if(4 * a - N == n + h)
                    {
                        printf("%d %d %d\n", h, n, a);
                        flag = true;
                        break;
                    }
                }
            }
            if(flag) break;
        }*/

        for(int i=N;h<MAXNUM;N+=N)
        {
            for(int j=1;j<i;j++)
            {
                if(i % j == 0)
                {
                    if(4 * i / N - N == i / j + j)
                    {
                        printf("%d %d %d\n", h, n, a);
                        flag = true;
                        break;
                    }
                }
            }
            if(flag) break;
        }
    }
    fflush(stdout);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:52: error: 'a' was not declared in this scope
   46 |                         printf("%d %d %d\n", h, n, a);
      |                                                    ^
Language: C++

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

//using
using VI = vector<int>;
using VVI = vector<VI>;
using VS = vector<string>;
using PII = pair<int, int>;
using LL = long long;

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);i++)
#define REP(i,n)  for(LL i=0;i<(n);i++)

//constant
const int INF = 1 << 29;
const double EPS = 1e-10;
const double PI = acos(-1.0);

//debug
#define dump(x)  cout << #x << " = " << (x) << endl;

int main() {
  LL N;
  cin >> N;
  N /= 2;
  // 4hnw == N(hn + nw + hw)
  FOR(i, 1, 3501) {
    FOR(j, i, 3501) {
      if(j>i+100) break;
      FOR(k, j, 3501) {
        if(2*i*k*j == N*(i*k + k*j + j*i)) {
          cout << i << ' ' << j << ' ' << k << endl;
          return 0;
        }
        if(k>j+100) break;
      }
    }
  }
  // cout << "error";
  cout << i << ' ' << j << ' ' << k << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:11: error: 'i' was not declared in this scope
   52 |   cout << i << ' ' << j << ' ' << k << endl;
      |           ^
a.cc:52:23: error: 'j' was not declared in this scope
   52 |   cout << i << ' ' << j << ' ' << k << endl;
      |                       ^
a.cc:52:35: error: 'k' was not declared in this scope
   52 |   cout << i << ' ' << j << ' ' << k << endl;
      |                                   ^
Language: C++

#include<stdio.h>

/*
	4/n=1/a+1/b+1/c
	=(ab+ac+bc)/abc
	4abc=n(ab+ac+bc)
	4abc/(ab+ac+bc)=n
	=4bc/(b+c)+4a
*/

/*
	4/n=1/a+1/b+1/c
	4abc=n(ab+ac+bc)
	=na(b+c)+nbc
	nbc=a(4bc-n(b+c))
	a==nbc/(4bc-nb-nc)
*/

int main()
{
	int n, a, b, c;
	scanf("%d", &n);
	
	for (a = 1; a <= 3500; a++)
		for (b = 0; b <= 3500; b++)
		{
			c = n*a*b / (4 * a*b - n*a - n*b);
			if ((int)c == c)
			{
				printf("%d %d %d", a, b, c);
				return 0;
			}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:20:1: note: to match this '{'
   20 | {
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <map>
using namespace std;
struct node{
long long A,B;
}a[100005];
int mmp(node x,node y)
{
    return x.A<y.A;
}
int main()
{
    int n;
    scanf("%d",&n);
    if(n%2==0)
    {
        cout<<n/2<<" "<<n<<" "<<n<<endl;;
        return 0;
    }
    if(n%3==0)
    {
        cout<<n/3<<" "<<n*2<<" "<<n*2<<endl;
    }
    for(int )
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: expected unqualified-id before ')' token
   27 |     for(int )
      |             ^
a.cc:27:12: error: expected ';' before ')' token
   27 |     for(int )
      |            ^~
      |            ;
a.cc:27:13: error: expected primary-expression before ')' token
   27 |     for(int )
      |             ^
a.cc:27:12: error: expected ';' before ')' token
   27 |     for(int )
      |            ^~
      |            ;
Language: C++

#define _USE_MATH_DEFINES

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

#define ll long long
const int MOD = 1000000007;//10^9+7

ll max(ll a, ll b) {

	if (a > b)return a;
	else return b;

}
//aとbの大きい方

ll min(ll a, ll b) {

	if (a < b)return a;
	else return b;

}
//aとbの小さい方

ll avd_i(ll a, ll b) {

	if (a > b)return a - b;
	else return b - a;

}
double avd_d(double a, double b) {

	double re;
	if (a > b)re = a - b;
	else re = b - a;
	return re;

}
//aとbの差の絶対値

ll powsur(ll a, ll b, ll p) {

	if (b == 0) {

		return 1;

	}
	else if (b % 2 == 0) {

		ll d = powsur(a, b / 2, p);
		return ((d%p)*(d%p)) % p;

	}
	else {

		return ((a%p)*powsur(a, b - 1, p) % p) % p;

	}

}
//pは素数,aのb乗をpで割った余り

ll CMOD(ll n, ll r, ll p) {

	ll a = 1, b = 1, c = 1, re;
	for (int i = 1; i <= n; i++) {

		a *= i;
		a = a%p;

	}
	for (int i = 1; i <= r; i++) {

		b *= i;
		b = b%p;

	}
	for (int i = 1; i <= n - r; i++) {

		c *= i;
		c = c%p;

	}
	b = powsur(b, p - 2, p);
	c = powsur(c, p - 2, p);
	re = ((a%p)*(b%p)) % p;
	re = ((re%p)*c%p) % p;

	return re;

}
//pは素数,(nCr)%p

ll gcd(ll a, ll b) {

	if (a > b) {

		ll tmp = a;
		a = b;
		b = tmp;

	}
	ll r;
	r = b%a;
	if (r == 0)return a;
	else return gcd(r, a);

}
//最大公約数

ll lcm(ll a, ll b) {

	return (a / gcd(a, b))*b;

}
//最小公倍数

int main() {
	
	int N;

	cin >> N;

	for (int i = 1; i * 4 <= 3 * N; i++) {

		for (int j = 1; 4 * i*j - N*j <= 2 * N*i; j++) {

			for (int k = 1; 4 * i*j*k - N*j*k - N*i*k <= N*i*j) {

				if (4 * i*j*k == N*j*k + N*i*k + N*i*j) {

					printf("%d %d %d\n", i, j, k);
					goto qwe;

				}

			}

		}

	}
	qwe:

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:135:75: error: expected ';' before ')' token
  135 |                         for (int k = 1; 4 * i*j*k - N*j*k - N*i*k <= N*i*j) {
      |                                                                           ^
      |                                                                           ;
Language: C++

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long starth;
		if(N%4==0) {
			starth = 3*N/4;
		} else {
			starth = 3*N/4+1;
		}
		for(long h=starth; h<=3500; h++) {
			for(long w=1; w<=3*N/4; w++) {
				for(long n=w; n<=h; n++) {
					if(4*h*n*w==N*(h*n+n*w+h*w)) {
						System.out.println(h + " " + n + " " + w);
						return;
					}
				}
			}
		}
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

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

int main(){
	double n,tmp;
	cin>>n;
	for(double x=1;x<=900;x++){
		for(double y=1;y<=900;y++){
			tmp=(1/n)-(1/(4*x)-1/(4*y);
			if(tmp<3500/4) {cout<<x<<" "<<y<<" "<<tmp<<endl;return 0;}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:51: error: expected ')' before ';' token
   10 |                         tmp=(1/n)-(1/(4*x)-1/(4*y);
      |                                   ~               ^
      |                                                   )
Language: C++

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <utility>
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

#define INF (1 << 30)
#define INFL (1LL << 62)
#define MOD7 1000000007
#define MOD9 1000000009
#define EPS 1e-10

#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pul pair<ull, ull>
#define all(a) (a).begin(), (a).end()
#define mp make_pair
#define pb push_back
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

void YES() { cout << "YES" << endl; }
void NO() { cout << "NO" << endl; }
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void yes() { cout << "yes" << endl; }
void no() { cout << "no" << endl; }
void Taka() { cout << "Takahashi" << endl; }
void Aoki() { cout << "Aoki" << endl; }
void digit(int d) { cout << fixed << setprecision(d); }
void IOup() { cin.tie(0); ios::sync_with_stdio(false); }

int main() {
	int N;
	cin >> N;
	for (int n = 1; n <= 3500; ++n) {
		for (int w = 1; w <= 3500; ++w) {
			int div = 4 * n * w - N * w - N * n;
			if (div <= 0)
				continue;
			double h = N * n * w / div;
			if (h > 0 && fabs(h - round(h)) < EPS) {
				printf("%lld %d %d\n", ll(h), n, w);
				return 0;
			}
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: expected primary-expression before 'long'
   29 | #define ll long long
      |            ^~~~
a.cc:63:56: note: in expansion of macro 'll'
   63 |                                 printf("%lld %d %d\n", ll(h), n, w);
      |                                                        ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
 
typedef long long ll;
typedef pair<int, int> ii;


int main() {
	
	ll n;
	cin >> n;
	
	REP(h, 1, 3501){
		REP(n, h, 3501){
			if(4*h*n <= n) continue;
			if((n * (h + w)) % (4*h*n - n) != 0) continue;
			cout << h << " " << n << " " << w << endl;
			return 0;
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:38: error: 'w' was not declared in this scope
   23 |                         if((n * (h + w)) % (4*h*n - n) != 0) continue;
      |                                      ^
a.cc:24:57: error: 'w' was not declared in this scope
   24 |                         cout << h << " " << n << " " << w << endl;
      |                                                         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  long N, K;
  cin >> N >> K;
  vector<pair<long, long>> data(N);
  vector<long> sub(30);
  for(int i = 0; i < N; i++)cin >> data.at(i).first >> data.at(i).second;
  for(int i = 0; i < 30; i++){
    sub.at(i) = K % 2;
    K /= 2;
  }
  long X = 0, subK, ans = 0, sum;
  for(int i = 29; i >= 0; i--){
    sum = 0;
    if(i != 29)X += pow(2, i + 1) * sub.at(i + 1);
    if(sub.at(i) == 1 && i != 0){
      subK = X + pow(2, i) - 1;
      for(int j = 0; j < N; j++){
        if((subK | data.at(j).first) == subK)sum += data.at(j).second;
      } 
    } else if(i == 0){
      if((K | data.at(j).first) == K)sum += data.at(j).second;
    }
    ans = max(ans, sum);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: 'j' was not declared in this scope
   23 |       if((K | data.at(j).first) == K)sum += data.at(j).second;
      |                       ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

using ull = unsigned long long;

typedef struct tpl{
  ull a;
  ull b;

  bool operator<( const tpl& right ) const {
    return a == right.a ? b < right.b : a < right.a;
  }
};

template <typename T>
inline std::string to_bin_str(T n) {
  std::string str;
  if(n==0){
    str = "0";
    else while (n > 0) {
      str.push_back('0' + (n & 1ULL));
      n >>= 1;
    }
    reverse(str.begin(), str.end());
    return str;
  }

  int main(void) {
    ull n, k;
    cin >> n >> k;
    cin.ignore();
    tpl c[n];
    //ull a[n], b[n];
    for (int i = 0; i < n; i++){
      //cin >> a[i] >> b[i];
      cin >> c[i].a >> c[i].b;
      cin.ignore();
    }

    // 1-finder

    string strk = to_bin_str(k);
    //cout << "strk = " << strk << endl;
    unsigned int klen = strk.length(); // kの長さ
    char cstrk[klen];
    strcpy(cstrk, strk.c_str());
    vector<ull> masks;
    ull mask;
    masks.push_back(k);
    unsigned int keta;
    //cout << "klen = " << klen << endl;
    //cout << "cstrk = " << cstrk << endl;
    for (int i = 0; i < klen; i++){
      if(cstrk[i] == '1'){
        keta = klen - i - 1;
        mask = k - (1 << keta);
        mask |= (1 << keta) - 1;
        //cout << "mask = " << mask << endl;
        masks.push_back(mask);
      }
    }

    vector <ull> anss;
    ull ans = 0;
    ull maxans = 0;
    for (auto itr = masks.begin(); itr != masks.end(); itr++){
      ans = 0;
      for (int m = 0; m < n; m++){
        if(*itr == (*itr | c[m].a)){
          ans+=c[m].b;
          //cout << "ans = " << ans << endl;
          //cout << "cmb = " << c[m].b << endl;
        }
      }
      if(maxans <= ans) maxans = ans;
      anss.push_back(ans);
    }
    cout << maxans << endl;

    return 0;
  }


Compiler output:
a.cc:7:1: warning: 'typedef' was ignored in this declaration
    7 | typedef struct tpl{
      | ^~~~~~~
a.cc: In function 'std::string to_bin_str(T)':
a.cc:21:5: error: expected '}' before 'else'
   21 |     else while (n > 0) {
      |     ^~~~
a.cc:19:11: note: to match this '{'
   19 |   if(n==0){
      |           ^
Language: C++

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

const int MAXN = 1e5+10;
int a[MAXN];
int b[MAXN];
int n,k;
int fac[31];

void init()
{
    for(int i = 0; i < 31; ++i)
        fac[i] = 1<<i;
}

int main()
{
    init();
    scanf("%d %d",&n,&k);
    long long res = 0;
    for(int i = 0; i < n; ++i)
    {
        scanf("%d %d",&a[i],&b[i]);
        if((a[i]&k)==a[i]) res += b[i];
    }
    for(int i = 30; i >= 0; --i)
    {
        if(k&fac[i])
        {
            int tmp = (k^fac[i])|(fac[i]-1);
            //printf("%d\n",tmp);
            int ans = 0;
            for(int j = 0; j < n; ++j)
                if((a[j]&tmp)==a[j]) ans += b[j];
            res = max(res,ans);
        }
    }
    printf("%lld\n",res);
    return 0;
}


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

import java.util.*;

public class D {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long K = sc.nextLong();
		long[] a = new long[N];
		long[] b = new long[N];
		for(int i=0; i<N; i++) {
			a[i] = sc.nextLong();
			b[i] = sc.nextLong();
		}
		sc.close();
		int r = 1;
		{
			long tempk = K;
			while((tempk = tempk/2) != 0) r++;
		}
		ArrayList<Long> ks = new ArrayList<Long>();
		ks.add(K);
		for(int i=0; i<=r; i++) {
			long tempk = K;
			if((tempk>>>i)%2==0) continue;
			tempk = tempk & ~(pow(2, i));
			if(i!=0) {
				tempk = tempk | (pow(2, i) -1);
			}
			ks.add(tempk);
		}
		long ans = 0;
		for(int i=0; i<ks.size(); i++) {
			long tempans = 0;
			long k = ks.get(i);
			for(int j=0; j<N; j++) {
				if((a[j]|k) == k) {
					tempans += b[j];
				}
			}
			ans = Math.max(ans, tempans);
		}
		System.out.println(ans);
		
	}
	
	static long pow(long a, long r) {
		if(r==0) return 1;
		if(r%2==0) {
			long d = pow(a, r/2);
			return d*d;
		} else {
			return pow(a, r-1) * a;
		}
	}
}


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