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

#include<stdio.h>
#include<math.h>
int 2pow(int n){
  int count=0;
  while(n%2 == 0){
    n = n/2;
    count++;
  }
  return count;
}
int main(){
  int N,a[10000],i;
  int sum=0;
  scanf("%d",&N)
  for (i=0;i<N;i++){
    scanf("%d",a[N]);
    sum += 2pow(a[N]);
  }
  printf("%d",sum);
  return 0;
}

Compiler output:
main.c:3:5: error: invalid suffix "pow" on integer constant
    3 | int 2pow(int n){
      |     ^~~~
main.c:3:5: error: expected identifier or '(' before numeric constant
main.c: In function 'main':
main.c:14:17: error: expected ';' before 'for'
   14 |   scanf("%d",&N)
      |                 ^
      |                 ;
   15 |   for (i=0;i<N;i++){
      |   ~~~            
main.c:17:12: error: invalid suffix "pow" on integer constant
   17 |     sum += 2pow(a[N]);
      |            ^~~~
Language: C++

x#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, ans = 0; cin >> n;
    for(int i = 0; i < n; i++) {
        int a;
        cin >> a;
        while(1) {
            if(a % 2 == 0) {
                ans++;
                a /= 2;
            } else {
                break;
            }
        }
    }
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | x#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'x' does not name a type
    1 | x#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:4:21: error: 'cin' was not declared in this scope
    4 |     int n, ans = 0; cin >> n;
      |                     ^~~
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << ans << endl;
      |     ^~~~
a.cc:17:20: error: 'endl' was not declared in this scope
   17 |     cout << ans << endl;
      |                    ^~~~
Language: C++


#include <iostream>
using namespace std;

int main() {
    
    int N;
    
    cin >> N;
    
    long a[N];
    
    for(int i=0; i<N; i++) {
        cin >> a[i];
    }
    
    int num = 0;
    while(true) {
        sort(a, a+N, greater<long>());
        
        bool is2bai = false;
        bool end = true;
        for(int i=0; i<N; i++) {
            if(a[i] % 2 == 0) {
                end = false;
                if(is2bai) {
                    a[i] = a[i] * 3;
                }
                else {
                    is2bai = true;
                    a[i] = a[i] / 2;
                }
            }
            else {
                a[i] = a[i] * 3;
            }
        }
        
        if(end) {
            break;
        }
        else {
            num++;
        }
    }
    
    cout << num << "\n";
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |         sort(a, a+N, greater<long>());
      |         ^~~~
      |         short
Language: C

#include<stdio.h>

int main() {
	long int D[10100] = 0 , N, i,j,result=0;
	scanf("%ld",&N);

	for (i = 0; i != N; i++) {
		scanf("%ld", &D[i]);
		for (j = 0; D[i] % 2 != 1; result++) { D[i] = D[i] / 2; }
	}
	printf("%ld",result);

}

Compiler output:
main.c: In function 'main':
main.c:4:29: error: invalid initializer
    4 |         long int D[10100] = 0 , N, i,j,result=0;
      |                             ^
Language: C++

# coding: utf-8

import math

N = int(input())

LIST = [int(i) for i in input().split()]

c = 0

for i in range(N):
    a = LIST[i]

    while a % 2 == 0:
        a = int(a /2)
        c += 1

print(c)


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:3:1: error: 'import' does not name a type
    3 | import math
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>

int main(){
  int n,cnt = 0;
  long long c;
  cin >> n ;
  for(int i=0;i<n;i++){
    c = 0;
    cin >> c ;
    while(c % 2 == 0){
      c = c / 2;
      cnt++;
    }
  }
  
  cout << cnt << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> n ;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |   cout << cnt << 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:16:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |   cout << cnt << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.util.Scanner;
public class ABC100 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N =sc.nextInt();
		int[] n =new int[N];
		for(int i=0;i<N;i++) {
			n[i]=sc.nextInt();
		}
		
		int m =0;
		int i=0;
		while(i<N) {
			
			if(n[i]%2==0) {
				n[i]=n[i]/2;
				m++;
			}else {
				i++;
			}
		}
		
		
		System.out.println(m);
	}
}

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

#include <iostream>
using namespace std;

int n, ans;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'N' was not declared in this scope
    7 |         cin >> N;
      |                ^
Language: C


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

int main(void)
{

	int N;
	
	scanf("%d",&N);
	
	int a[N];

	for (int i=0; i<N; i++){
		scanf("%d",&a[i]);
	}

	int mod2 = 0;
	int loop = 0;
	int k,j = 0;

	for (k=0; k < 10000; k++){
		mod2 = 0;
		j=0;
		for (j=0; j<N; j++){
			if ( a[j]%2==0)) {
				loop = loop + 1;
				a[j] = a[j]/2;
			}
		}
	}

	printf("%d",loop);

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:26:40: error: expected statement before ')' token
   26 |                         if ( a[j]%2==0)) {
      |                                        ^
Language: C++

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


int cmpfunc (const void * a, const void * b) {
   return ( *(long*)a - *(long*)b );
}

int main(int argc, char** argv) {
        int n, i = 0;
        long nr_cnt = 0;
        long odd_max = -1;
        long odd_index = -1;
        long* a;
        scanf("%d", &n);
        a = malloc(sizeof(long) * n);

        for (i = 0; i < n; i++) {
                scanf("%ld", &a[i]);
        }


        qsort(a, n, sizeof(long), cmpfunc);

        while (1) {
                // find max
                odd_max = -1;
                odd_index = -1;
                for (i = n - 1; i >= 0; i--) {
                        if ((a[i] % 2) == 0) {
                                odd_max = a[i];
                                odd_index = i;
                                break;
                        }
                }

                if (odd_max == -1) {
                        break;
                }

                for (i = 0; i < n; i++) {
                        if (i == odd_index) {
                                a[i] /= 2;
                                if (a[i] == 0) {
                                        break;
                                }
                        } else {
                                a[i] *= 3;
                        }
                }
                nr_cnt++;
        }

        printf("%ld\n", nr_cnt);


        return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:16:19: error: invalid conversion from 'void*' to 'long int*' [-fpermissive]
   16 |         a = malloc(sizeof(long) * n);
      |             ~~~~~~^~~~~~~~~~~~~~~~~~
      |                   |
      |                   void*
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, bb, b;
  cin >> a;
  b = 1;
  int count = 0;
  for (int i = 0; i < a; i++) {
    cin >> bb;
    b *= bb;
  }
  while (ceil(b) == floor(b)) {
    b /= 2;
    count++;
  }
  cout << count - 1 << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:16:29: error: expected '}' at end of input
   16 |   cout << count - 1 << endl;
      |                             ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    int a, ans = 0;
    rep(i, 0, n){
        cin>>a;
        while (a & 1 ^ 1) { // aの1ビット目だけを取って1ビット目を反転(2進数なので1ビット目が0なら2で割れる)
            a >>=1 ; // aを1ビット右にずらす(2進数なので2で割る)
            ans++;
        }
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i, 0, n){
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope
    7 |     rep(i, 0, n){
      |     ^~~
Language: C++

#include<stdio.h>

int main()
{
	int n,i,max,count,j;
	max = 0;
	count = 0;
	scanf("%d", &n);
	int a[n];
	for (i = 0; i < n; i++)
	{
		scanf("%d", &a[i]);
	}
	for (i = 0; i < n; i++)
	{
		if (a[i] % 2 == 0)
		{
			for (j = 0; a[i] % 2 == 0; j++)
			{
				a[i] = a[i] / 2;
				count++
			}
		}
	}
	printf("%d", count);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:40: error: expected ';' before '}' token
   21 |                                 count++
      |                                        ^
      |                                        ;
   22 |                         }
      |                         ~
Language: C

#include <stdio.h>
#include <math.h>
int main() {
	int n,i;
	long a;
	long ret = 0;
	scanf_s("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &a);
		while (a % 2 == 0) {
			ret++;
			a = a / 2;
		}
	}
	printf("%ld", ret);
	return 0;
}


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

#include<stdio.h>

int main()
{
	int n,i,max,count,j;
	max = 0;
	count = 0;
	scanf("%d", &n);
	int a[n];
	for (i = 0; i < n; i++)
	{
		if (a[i] % 2 == 0)
		{
			for (j = 0; a[i] % 2 == 0; j++)
			{
				a[i] = a[i] / 2;
				count++
			}
		}
	}
	printf("%d", count);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:40: error: expected ';' before '}' token
   17 |                                 count++
      |                                        ^
      |                                        ;
   18 |                         }
      |                         ~
Language: C++

#include<stdio.h>

int main()
{
	int n,i,max,count,j;
	max = 0;
	count = 0;
	scanf("%d", &n);
	int a[n];
	for (i = 0; i < n; i++)
	{
		if (a[i] % 2 == 0)
		{
			for (j = 0; a[i] % 2 == 0; j++)
			{
				a[i] = a[i] / 2;
				count++
			}
		}
	}
	printf("%d", count)
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:40: error: expected ';' before '}' token
   17 |                                 count++
      |                                        ^
      |                                        ;
   18 |                         }
      |                         ~               
a.cc:21:28: error: expected ';' before 'return'
   21 |         printf("%d", count)
      |                            ^
      |                            ;
   22 |         return 0;
      |         ~~~~~~
Language: C++

#include<stdio.h>

int main()
{
	int n,i,max,count;
	max = 0;
	count = 0;
	scanf("%d", &n);
	int a[n];
	for (i = 0; i < n; i++)
	{
		if (a[i] % 2 == 0)
		{
			for (j = 0; a[i] % 2 == 0; j++)
			{
				a[i] = a[i] / 2;
				count++
			}
		}
	}
	printf("%d", count)
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: 'j' was not declared in this scope
   14 |                         for (j = 0; a[i] % 2 == 0; j++)
      |                              ^
a.cc:17:40: error: expected ';' before '}' token
   17 |                                 count++
      |                                        ^
      |                                        ;
   18 |                         }
      |                         ~               
a.cc:21:28: error: expected ';' before 'return'
   21 |         printf("%d", count)
      |                            ^
      |                            ;
   22 |         return 0;
      |         ~~~~~~
Language: C++

#include<stdio.h>

int main()
{
	int n,i,max,count;
	max = 0;
	count = 0;
	scanf("%d", &n);
	int a[n];
	for (i = 0; i < n; i++)
	{
		if (a[i] % 2 == 0)
		{
			if (max <= a[i])
			{
				max = a[i];
			}
		}
	}
	for (i = 0; max != 1; i++)
	{
		max = max / 2;
		count++;
	}
	printf("%d", count)
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:28: error: expected ';' before 'return'
   25 |         printf("%d", count)
      |                            ^
      |                            ;
   26 |         return 0;
      |         ~~~~~~
Language: C++

#include <iostream>
#include<cmath>
#include<algorithm>
#include <cassert>
#include <stdio.h>
using namespace std;
int main()
{
	int n =0,count=0,c=0;
	cin >> n;
	int a[10000];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
		for (int m = 0; m < n; m++) {
			if(a[m]%2==0){
				c++;
			}
		
		if (c > 0) {
			count++;
			for (int t = 0; t < n; t++) {
				a[t] / 2;	
			}
			c = 0;
		}
		else { cout << count; }
		
	
	
	
}

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

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    long long int n, c = 0, b[10000];
    cin >> n;
    bool found = true;
    for (int i = 0; i < n; i++) cin >> b[i];
    while (found == true)
    {
        for (int i = 0; i < n; i++) cout << b[i] << " ";
        cout << endl;
        found = false;
        for (int i = 0; i < n; i++)
        {
            if (b[i] % 2 == 0)
            {
                if (found == true) b[i] *= 3;
                else
                {
                    found = true;
                    b[i] /= 2;
                    c++;
                }
            }
            else
            {
                b[i] *= 3
                b[i] %= 10;
            }
        }
    }
    cout << c;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: expected ';' before 'b'
   31 |                 b[i] *= 3
      |                          ^
      |                          ;
   32 |                 b[i] %= 10;
      |                 ~
Language: C++

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

int check(int number,int num){
    if(number%2 ==0){
        num += 1;
        number = number/2;
        check(number,num);
    }else{
        return num;
    }
}

int main(){
    int mx;
    int *buf;
    scanf("%d", &mx);
    buf = malloc(mx * sizeof(*buf));
    for(int i = 0;i < mx; i++)
        scanf("%d", buf+i);
    int answer = 0;
    for(int k = 0;k < mx;k++){
        answer += check(buf[k],0);
    }
    printf("%d\n",answer);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   18 |     buf = malloc(mx * sizeof(*buf));
      |           ~~~~~~^~~~~~~~~~~~~~~~~~~
      |                 |
      |                 void*
a.cc: In function 'int check(int, int)':
a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
   12 | }
      | ^
Language: C++

#include<vector>
#include<iostream>
#include<algorithm>
#include<tuple>
#include<string>
#include<bits/stdc++.h>
using namespace std;

void solve(){
    int N,cnt,ans;
    double a;
    vector<double> v;//a_i
    vector<bool> b;//偶数か奇数か
    cin>>N;
    v[0]=0;
    int num=0;
    for(int i=1;i<=N;i++){
        cin>>a;
        v.push_back(a);
        if(a%2==0){b.push_back(false);num++;}
        else b.push_back(true);
    }
    ans=0;
    int j=0;
    cnt=0;
        while(num>0){
            for(int i=1;i<=N;i++){
            
            if (ceil(v[i]) != floor(v[i])) {
　　　          　//printf("This is not an int\n");
                break;
                
　　        } else {
　　　　          //printf("This is an int\n" );
　　            if(v[i]%2==0){
                    v[i]=v[i]/2;
            
                    if((v[i]%2)!=0){b[i]=true;num--;}
}
                else{
                    v[i]=v[i]*3;
                
                }

                    }

        
}
    cnt++;
    ans=max(ans,cnt);
    }
    cout<<ans-1<<endl;

}

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

Compiler output:
a.cc:30:1: error: extended character 　 is not valid in an identifier
   30 | 　　　          　//printf("This is not an int\n");
      | ^
a.cc:30:1: error: extended character 　 is not valid in an identifier
a.cc:30:1: error: extended character 　 is not valid in an identifier
a.cc:30:17: error: extended character 　 is not valid in an identifier
   30 | 　　　          　//printf("This is not an int\n");
      |                 ^
a.cc:33:1: error: extended character 　 is not valid in an identifier
   33 | 　　        } else {
      | ^
a.cc:33:1: error: extended character 　 is not valid in an identifier
a.cc:34:1: error: extended character 　 is not valid in an identifier
   34 | 　　　　          //printf("This is an int\n" );
      | ^
a.cc:34:1: error: extended character 　 is not valid in an identifier
a.cc:34:1: error: extended character 　 is not valid in an identifier
a.cc:34:1: error: extended character 　 is not valid in an identifier
a.cc:35:1: error: extended character 　 is not valid in an identifier
   35 | 　　            if(v[i]%2==0){
      | ^
a.cc:35:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'void solve()':
a.cc:20:13: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   20 |         if(a%2==0){b.push_back(false);num++;}
      |            ~^~
      |            | |
      |            | int
      |            double
a.cc:30:1: error: '\U00003000\U00003000\U00003000' was not declared in this scope
   30 | 　　　          　//printf("This is not an int\n");
      | ^~~~~~
a.cc:33:1: error: '\U00003000\U00003000' was not declared in this scope
   33 | 　　        } else {
      | ^~~~
a.cc:34:1: error: '\U00003000\U00003000\U00003000\U00003000' was not declared in this scope
   34 | 　　　　          //printf("This is an int\n" );
      | ^~~~~~~~
a.cc:40:17: error: 'else' without a previous 'if'
   40 |                 else{
      |                 ^~~~
Language: C++

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

int main() {
  int n,b=30,d,i,e,g=0;
  cin >> n;
  int a[10000];
  for(i=0;i!=n;i++){
    cin >> a[i];
    for(e=0;e!=1;e--){
      d=a[i]%2;
      if(d==1){
        if(g<d){
          d=f;
        }
        break;
      }
      a[i]=a[i]/2;
      g=g+1;
    }
  }
  d=d+n;
  cout << d << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'f' was not declared in this scope
   14 |           d=f;
      |             ^
Language: C

#include <stdio.h>


int main(int argc, char **argv){
    int n,x;
    x = 0;
    scanf("%d",&n);
    int a[n];
    for(i = 0 ; i < n ; i++){
        scanf("%d",&a[i]);
    }
    int i,xxx;
    for(i = 0 ; i < n ; i++){
        xxx = 1;
        while(xxx == 1){
            if(a[i] % 2 == 0){
                a[i] = a[i] / 2;
                x++;
            }
            else
                xxx = 0;
        }
    }
    printf("%d\n",x);

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:9: error: 'i' undeclared (first use in this function)
    9 |     for(i = 0 ; i < n ; i++){
      |         ^
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    long long int a,ans,b[100];
    cin>>a;
    for(int i=0;i<a;i++){
        cin>>b[i];
        for(b[i]%2==0 && b[i]!=0){
            b[i]=b[i]/2;
            ans++;
        }
    }
    cout<<ans<<endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:33: error: expected ';' before ')' token
   10 |         for(b[i]%2==0 && b[i]!=0){
      |                                 ^
      |                                 ;
a.cc:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
a.cc:13:10: error: expected ';' before '}' token
   13 |         }
      |          ^
      |          ;
   14 |     }
      |     ~     
a.cc:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
a.cc:13:10: error: expected ')' before '}' token
   13 |         }
      |          ^
      |          )
   14 |     }
      |     ~     
a.cc:10:12: note: to match this '('
   10 |         for(b[i]%2==0 && b[i]!=0){
      |            ^
a.cc:14:5: error: expected primary-expression before '}' token
   14 |     }
      |     ^
Language: C++

int main() {
	int N, a[10000];
	cin >> N;
	int i;
	if (1 <= N <= 10000) {
		for (i = 1;i <= N;i++) {
			cin >> a[i-1];
		}
	}
	int k = 0;
	while (1) {
		int j = 0;
		while (a[j] % 2 == 1) {
			j++;
			if (j == N) break;
		}
		if (j == N) break;
		else for (int i = 0;i < N;i++) {
			if (i==j) a[i] /= 2;
			else a[i] *= 3;
		}
		k++;
	}
	cout << k;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> N;
      |         ^~~
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout << k;
      |         ^~~~
Language: C++

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

int main() {
  int n,b=30,d,i,e,g=0;
  cin >> n;
  int a[10000];
  for(i=0;i!=n;i++){
    cin >> a[i];
    for(e=0;e!=1;e--){
      d=a[i]%2;
      if(d==1){
        if(g<d){
          d=f;
        }
        break;
      }
      a[i]=a[i]/2
      g=g+1;
    }
  }
  d=d+n;
  cout << d << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'f' was not declared in this scope
   14 |           d=f;
      |             ^
a.cc:18:18: error: expected ';' before 'g'
   18 |       a[i]=a[i]/2
      |                  ^
      |                  ;
   19 |       g=g+1;
      |       ~
Language: C++

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

int main() {
  int n,b=30,d,i,e,f=0;
  cin >> n;
  int a[10000];
  for(i=0;i!=n;i++){
    cin >> a[i];
    for(e=0;e!=1;e--){
      d=a[i]%2;
      if(d==1){
        if(f<d){
          d=f;
        }
        break;
      }
      a[i]=a[i]/2
      f=f+1;
    }
  }
  d=d+n;
  cout << d << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: expected ';' before 'f'
   18 |       a[i]=a[i]/2
      |                  ^
      |                  ;
   19 |       f=f+1;
      |       ~
Language: C++

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

int main() {
  int n,b=30,d,i,e;
  cin >> n;
  int a[10000];
  for(i=0;i!=n;i++){
    int f=0;
    cin >> a[i];
    for(e=0;e!=1;e--){
      d=a[i]%2;
      if(d==1){
        if(f<d){
          d=f;
        }
        break;
      }
      a[i]=a[i]/2
      f=f+1;
    }
  }
  d=d+n;
  cout << d << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: expected ';' before 'f'
   19 |       a[i]=a[i]/2
      |                  ^
      |                  ;
   20 |       f=f+1;
      |       ~
Language: C++

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

int main() {
  int n,b=30,d,i;
  cin >> n;
  int a[10000];
  for(i=0;i!=n;i++){
    int f=0;
    cin >> a[i];
    for(e=0;e!=1;e--){
      d=a[i]%2;
      if(d==1){
        if(f<d){
          d=f;
        }
        break;
      }
      a[i]=a[i]/2
      f++;
    }
  }
  d=d+n;
  cout << d << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'e' was not declared in this scope
   11 |     for(e=0;e!=1;e--){
      |         ^
a.cc:19:18: error: expected ';' before 'f'
   19 |       a[i]=a[i]/2
      |                  ^
      |                  ;
   20 |       f++;
      |       ~
Language: C++

#include<stdio.h>
int c,i=0;
int a[10000];
int main(){
scanf("%d",&c);
for(int k=0;k<c;k++){
scanf("%d",&a[k]);
for(int j=0;a[k]%2=0;i++)a[k]=a[k]/2;
}
printf("%d",i);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: lvalue required as left operand of assignment
    8 | for(int j=0;a[k]%2=0;i++)a[k]=a[k]/2;
      |             ~~~~^~
Language: C++

#include<stdio.h>
int c,i=0;
int a[10000];
int main(){
scanf("%d",&c);
for(int k=0;k<c;k++){
scanf("%d",&a[k]);
fot(int j=0;a[k]%2=0;i++)a[k]=a[k]/2;
}
printf("%d",i);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected primary-expression before 'int'
    8 | fot(int j=0;a[k]%2=0;i++)a[k]=a[k]/2;
      |     ^~~
a.cc:8:17: error: lvalue required as left operand of assignment
    8 | fot(int j=0;a[k]%2=0;i++)a[k]=a[k]/2;
      |             ~~~~^~
a.cc:8:25: error: expected ';' before ')' token
    8 | fot(int j=0;a[k]%2=0;i++)a[k]=a[k]/2;
      |                         ^
      |                         ;
Language: Java

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] array = new long[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        int ans = 0;
        boolean b = true;
        while(b) {
            for (int i = n - 1; i >= -1; i--) {
                if (i == -1) {
                    b = false;
                } else {
                    if (array[i] % 2 == 0) {
                        array[i] /= 2;
                        ans++;
                        break;
                    }
                }
            }
        }
        System.out.println(ans);
    }    
}


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

#include <iostream>

using namespace std;

int main()
{
    int n, c = 0, b[10000];
    cin >> n;
    bool found = true;
    for (int i = 0; i < n; i++) cin >> b[i];
    while (found == true)
    {
        for (int i = 0; i < n; i++) cout << b[i] << " ";
        cout << endl;
        found = false;
        for (int i = 0; i < n; i++)
        {
            if (b[i] % 2 == 0)
            {
                if (found == true) 
                {
                    b[i] *= 3;
                    b %= 10;
                }
                else
                {
                    found = true;
                    b[i] /= 2;
                    b %= 10;
                    c++;
                }
            }
            else b[i] *= 3;
        }
    }
    cout << c;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: invalid operands of types 'int [10000]' and 'int' to binary 'operator%'
   23 |                     b %= 10;
      |                     ~~^~~~~
a.cc:23:23: note:   in evaluation of 'operator%=(int [10000], int)'
a.cc:29:23: error: invalid operands of types 'int [10000]' and 'int' to binary 'operator%'
   29 |                     b %= 10;
      |                     ~~^~~~~
a.cc:29:23: note:   in evaluation of 'operator%=(int [10000], int)'
Language: C++

#include<stdio.h>
int a,i=0;
int a[10000];
scanf("%d",&a);
for(int k=0;k<a;k++){
scanf("%d",&a[k]);
fot(int j=0;a[k]%2=0;i++)a[k]=a[k]/2;
}
printf("%d",i);
return 0;
}


Compiler output:
a.cc:3:5: error: conflicting declaration 'int a [10000]'
    3 | int a[10000];
      |     ^
a.cc:2:5: note: previous declaration as 'int a'
    2 | int a,i=0;
      |     ^
a.cc:4:6: error: expected constructor, destructor, or type conversion before '(' token
    4 | scanf("%d",&a);
      |      ^
a.cc:5:1: error: expected unqualified-id before 'for'
    5 | for(int k=0;k<a;k++){
      | ^~~
a.cc:5:13: error: 'k' does not name a type
    5 | for(int k=0;k<a;k++){
      |             ^
a.cc:5:17: error: 'k' does not name a type
    5 | for(int k=0;k<a;k++){
      |                 ^
a.cc:9:7: error: expected constructor, destructor, or type conversion before '(' token
    9 | printf("%d",i);
      |       ^
a.cc:10:1: error: expected unqualified-id before 'return'
   10 | return 0;
      | ^~~~~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C

#include<stdio.h>
int main()
{
    int N,i,b,c = 1;
    int a[10000];

    scanf("%d", &N);
    for(i = 0;i < N;i++){
    	scanf("%d",&a[i]);
    }
    
    for(j = 0;j < N;j++){
    	while(1){
    		if(a[j] % 2 = 1)
    			break;
    		a[j] = a[j]/2;
    		b++;
    	}
    	b = 0;
    	c = c + b;
    }

    printf("%d",c);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:9: error: 'j' undeclared (first use in this function)
   12 |     for(j = 0;j < N;j++){
      |         ^
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
{
    int N,i,c = 1;
    int a[10000];
    int b[10000] = {0};

    scanf("%d", &N);
    for(i = 0;i < N;i++){
    	scanf("%d",&a[i]);
    	while(){
    		if(a[i] % 2 = 1)
    			break;
    		a[i] = a[i]/2;
    		b[i]++;
    	}
    	c = c + b[i];
    }

    printf("%d",c);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:15: error: expected expression before ')' token
   11 |         while(){
      |               ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: expected ';' before '}' token
   14 |       a = a/2
      |              ^
      |              ;
   15 |     }
      |     ~
Language: C++

#include<stdio.h>
#include<math.h>
int main(void)
{
	int N,a[N],i,A,C;
	double B,c;

	scanf("%d",&N);
	c=0.0;
	for(i=1;i<=N;i++)
	{
		scanf("%d",&a[i]);
		A=a[i];
		C=A%2;
		if(C==0)
		{
			c=c+1;
		}
	}
	B=pow(2.0,c)-1;
	printf("%lf",B);
	return 0;


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

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector> 
#include <cstring>
#include <queue>
#include <ctime>
#include <set>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
const ll INF = 1ll<<50;
const int IINF = 1000000009;
const int maxP = 1000010;
const int maxN = 10005;
const int maxM = 200010;
int n;

int a[maxn];

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]); 
	}
	ll ans = 0;
	for(int i=1;i<=n;i++)
	{
		if(a[i]%2 == 0)
		{
			ans += (ll)(a[i]/2);
		}
	}
	printf("%lld\n",ans);
	return 0;
} 

Compiler output:
a.cc:22:7: error: 'maxn' was not declared in this scope; did you mean 'maxN'?
   22 | int a[maxn];
      |       ^~~~
      |       maxN
a.cc: In function 'int main()':
a.cc:29:29: error: 'a' was not declared in this scope
   29 |                 scanf("%d",&a[i]);
      |                             ^
a.cc:34:20: error: 'a' was not declared in this scope
   34 |                 if(a[i]%2 == 0)
      |                    ^
Language: Java

import java.util.Scanner;
public class Question100 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
		int[] b = new int[N];
		int ans = 0;

		for(int i=0; i<N; i++) {
			a[i] = sc.nextInt();
			b[i] = 0;
			while(a[i]%2 == 0) {
				a[i] = a[i]/2;
				b[i] ++;
			}
			if(b[i] != 0) {
				b[i] += 1;
			}
			if(ans < b[i]) {
				ans = b[i];
			}
		}
		System.out.println(ans);

	}

}


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

#include <stack>
#include <queue>
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
 
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n0,n) for(int i=n0;i<n;i++)
#define Com(i,j,n) for(int i=0;i<n-1;i++)for(int j=i+1;j<n;j++)
#define INF (1<<29)
#define test cout << "test" << endl;

long int ni(long int a){
	if(a%2 ==1) return 0;
	else return ni(a/2)+1;
}

int main (){
	int NNN;
	cin >> NNN;
	long int a[NNN];
	int sum =0;
	rep(i,NNN){
		cin >> a[i];
		sum += ni(a[o]);
	}
	cout << sum ;

	cout << endl;


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:29: error: 'o' was not declared in this scope
   29 |                 sum += ni(a[o]);
      |                             ^
Language: C++

#include<bits/stdc++.h>
const int M = 100005 ;
using namespace std ;
int n ;
int a[M] ;
ll Ans ;
inline ll Solve(int x){
	int tim = 0 ;
	while(x%2==0){
		x >>=1;
		++tim ;
	}
	return tim ;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++) {
	    scanf("%d",&a[i]);
	    Ans += Solve(a[i]) ;
	}
	cout<<Ans<<endl ;
	return 0 ;
}


Compiler output:
a.cc:6:1: error: 'll' does not name a type
    6 | ll Ans ;
      | ^~
a.cc:7:8: error: 'll' does not name a type
    7 | inline ll Solve(int x){
      |        ^~
a.cc: In function 'int main()':
a.cc:19:13: error: 'Ans' was not declared in this scope
   19 |             Ans += Solve(a[i]) ;
      |             ^~~
a.cc:19:20: error: 'Solve' was not declared in this scope
   19 |             Ans += Solve(a[i]) ;
      |                    ^~~~~
a.cc:21:15: error: 'Ans' was not declared in this scope
   21 |         cout<<Ans<<endl ;
      |               ^~~
Language: C++

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

typedef long long ll;

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

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

using namespace std;

int main(void){

    int N = log(1000000000);

    int a[N];

    REP(i,N){
        a[i] = pow(2,i);
    }

    sort(&a[0], &a[N], greater<int>());

    int n;
    cin >> n;
    int arr[n];

    REP(i,n){
        cin >> arr[i];
    }

    int cnt = 0;

    REP(i,N){
        REP(j,n){
            if(a[i] == 1) break;
            if(arr[j] % a[i] == 0) {
                cnt += i;
            }
        }
    }

    cout << cnt << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   23 |     sort(&a[0], &a[N], greater<int>());
      |     ^~~~
      |     sqrt
Language: C++

#include<stdio.h>
int a,i=0;
int a[10000];
scanf("%d,&a);
for(int k=0;k<a;k++){
scanf("%d",&a[k]);
fot(int j=0;a[k]%2=0;i++)a[k]=a[k]/2;
}
printf("%d",i);
return 0;
}

Compiler output:
a.cc:4:7: warning: missing terminating " character
    4 | scanf("%d,&a);
      |       ^
a.cc:4:7: error: missing terminating " character
    4 | scanf("%d,&a);
      |       ^~~~~~~~
a.cc:3:5: error: conflicting declaration 'int a [10000]'
    3 | int a[10000];
      |     ^
a.cc:2:5: note: previous declaration as 'int a'
    2 | int a,i=0;
      |     ^
a.cc:4:6: error: expected constructor, destructor, or type conversion before '(' token
    4 | scanf("%d,&a);
      |      ^
a.cc:5:13: error: 'k' does not name a type
    5 | for(int k=0;k<a;k++){
      |             ^
a.cc:5:17: error: 'k' does not name a type
    5 | for(int k=0;k<a;k++){
      |                 ^
a.cc:9:7: error: expected constructor, destructor, or type conversion before '(' token
    9 | printf("%d",i);
      |       ^
a.cc:10:1: error: expected unqualified-id before 'return'
   10 | return 0;
      | ^~~~~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

#include<stdio.h>
int a,i=0;
int a[10000];
scanf("%d#,&a);
for(int k=0;k<a;k++){
scanf("%d",&a[k]);
fot(int j=0;a[k]%2=0;i++)a[k]=a[k]/2;
}
printf("%d",i);
return 0;
}

Compiler output:
a.cc:4:7: warning: missing terminating " character
    4 | scanf("%d#,&a);
      |       ^
a.cc:4:7: error: missing terminating " character
    4 | scanf("%d#,&a);
      |       ^~~~~~~~~
a.cc:3:5: error: conflicting declaration 'int a [10000]'
    3 | int a[10000];
      |     ^
a.cc:2:5: note: previous declaration as 'int a'
    2 | int a,i=0;
      |     ^
a.cc:4:6: error: expected constructor, destructor, or type conversion before '(' token
    4 | scanf("%d#,&a);
      |      ^
a.cc:5:13: error: 'k' does not name a type
    5 | for(int k=0;k<a;k++){
      |             ^
a.cc:5:17: error: 'k' does not name a type
    5 | for(int k=0;k<a;k++){
      |                 ^
a.cc:9:7: error: expected constructor, destructor, or type conversion before '(' token
    9 | printf("%d",i);
      |       ^
a.cc:10:1: error: expected unqualified-id before 'return'
   10 | return 0;
      | ^~~~~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

// UNNECESSARY
// #include <chrono>//std::chrono::/system_clock/steady_clock/high_resolution_clock/duration
// #include <cstdio>//printf/scanf/fopen/fclose/fprintf/fscanf/snprintf/putc/puts/getc/gets
// #include <fstream>//ifstream/ofstream

// DATA STRUCTURES
#include <array>
#include <bitset>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <valarray>
#include <vector>

// MISCELLANEOUS
#include <algorithm>//min/max/sort(rand-access it)/merge
#include <cassert>
#include <climits>//INT_MAX/INT_MIN/ULLONG_MAX
#include <cmath>//fmin/fmax/fabs/sin(h)/cos(h)/tan(h)/exp/log/pow/sqrt/cbrt/ceil/floor/round/trunc
#include <cstdlib>//abs/atof/atoi/atol/atoll/strtod/strtof/..., srand/rand, calloc/malloc, exit, qsort
#include <iomanip>//setfill/setw/setprecision/fixed/scientific
#include <iostream>//cin/cout/wcin/wcout/left/right/internal/dec/hex/oct/fixed/scientific
#include <iterator>
#include <limits>//numeric_limits<type>::max/min/lowest/epsilon/infinity/quiet_NaN/signaling_NaN
#include <new>
#include <string>//stoi/stol/stoul/stoll/stoull/stof/stod/stold/to_string/getline
#include <utility>//pair

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

#ifndef REPST
#define REPST(i,n) for (size_t i = 0; i < n; ++i)
#endif

#ifndef READ
#define READ(x) std::cin >> x
#endif

typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int, int> pii;
typedef std::pair<ll, int> plli;
typedef std::pair<ull, int> puli;
typedef std::pair<double, int> pdi;
typedef std::pair<ll, ll> pllll;
typedef std::pair<ull, ull> pulul;
typedef std::pair<double, double> pdd;
typedef std::tuple<int, int, int> ti3;
typedef std::tuple<int, int, int, int> ti4;

const bool debug = true;

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

using namespace std;

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

    int count = 0;

    REP(i,n) {
        int a;
        cin >> a;
        while (a % 2 == 0) {
            ++count;
            a /= 2;
        }
    }

    cout << count.to_string << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:19: error: request for member 'to_string' in 'count', which is of non-class type 'int'
   79 |     cout << count.to_string << endl;
      |                   ^~~~~~~~~
Language: Java



import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public final class D {

    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String[] line = in.nextLine().split(" ");
        final int n = Integer.parseInt(line[0]);
        final int k = Integer.parseInt(line[1]);
        long[][] cakes = new long[n][3];
        for (int i = 0; i < n; i++) {
            line = in.nextLine().split(" ");
            cakes[i][0] = Long.parseLong(line[0]);
            cakes[i][1] = Long.parseLong(line[1]);
            cakes[i][2] = Long.parseLong(line[2]);
        }
        System.out.println(dfs(cakes, 0, k, 0, 0, 0, new HashMap<>()));
    }

    private static long dfs(long[][] cakes, int idx, int k, long b, long t, long p, Map<String, Long> dp) {
        if (idx == cakes.length) {
            return k == 0 ? (Math.abs(b) + Math.abs(t) + Math.abs(p)) : 0;
        }
        String key = idx + "," + k + ',' + b + ',' + t + ',' + p;
        if (dp.containsKey(key)) {
            return dp.get(key);
        }
        long res = dfs(cakes, idx + 1, k, b, t, p, dp);
        if (k > 0) {
            res = Math.max(res,
                           dfs(cakes, idx + 1, k - 1, b + cakes[idx][0], t + cakes[idx][1], p + cakes[idx][2],
                               dp));
        }
        dp.put(key, res);
        return res;
    }
}


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

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

#define gcd(a,b)		__gcd(a,b)
#define lcm(a,b)		(a*b)/gcd(a,b)
#define ff              first
#define ss              second
#define int             long long
#define pb              emplace_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             INT_MAX
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define all(x)			x.begin(),x.end()
#define digits(x)		floor(log10(x))+1
#define FIO				ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

class dsu {
private:
	int *id;
	int* sz;

	int root(int i) {
		while (i != id[i]) {
			id[i] = id[id[i]];
			i = id[i];
		}
		return i;
	}
public:
	int n;
	dsu(int v) {
		n = v;
		id = new int[n];
		sz = new int[n];

		for (int i = 0; i < n; i++) {
			id[i] = i;
			sz[i] = 0;
		}
	}

	bool find(int p , int q) {
		return root(p) == root(q);
	}

	void join(int p , int q) {
		int i = root(p);
		int j = root(q);
		if (i == j) {
			return;
		}
		if (sz[i] < sz[j]) {
			id[i] = j ;
			sz[j] += sz[i];
		}
		else {
			id[j] = i;
			sz[i] += sz[j];
		}
	}
};

int nCr(int n , int r ) {
	int p = 1, k = 1;

	if (n - r < r ) {
		r = n - r;
	}
	if (r != 0) {
		while (r != 0) {
			p *= n ;
			k *= r ;
			int m = __gcd(p, k);
			p /= m;
			k /= m;
			n--;
			r--;
		}
	}
	else {
		p = 1;
	}
	return p ;
}

int modPower(int x, int y , int p) {
	//Used to calculate (x^y)%p
	int res = 1;
	if (y == 0) {
		return 1;
	}

	x = x % p;
	if (x == 0) {
		return 0  ;
	}

	while (y > 0) {
		if (y & 1) {
			res = (res * x) % p;
		}

		y >>= 1;
		x = (x * x) % p;
	}
	return res ;

}


int32_t main() {
	FIO;

	int n, m ;
	cin >> n >> m;

	int a[100009][3];
	for (int i = 1 ; i <= n ; i++) {
		for (int j = 0 ; j < 3 ; j++) {
			cin >> a[i][j];
		}
	}
	int val = INT_MIN;
	for (int i = 0 ; i < 8 ; i++) {
		vi v ;
		for (int j = 1 ; j <= n ; j++) {
			int s = 0 ;
			for (int k = 0 ; k < 3 ; k++) {
				if ((i / (1 << k)) % 2 == 0) {
					s += a[j][k];
				}
				else {
					s -= a[j][k];
				}
			}
			v.pb(s);
		}
		sort(all(v));
		dreverse(all(v));
		int ans = 0 ;
		for (int j = 0 ; j < m ; j++) {
			ans += v[j];
		}
		val = max(val, ans);
	}




	cout << val;





	return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:149:17: error: 'dreverse' was not declared in this scope
  149 |                 dreverse(all(v));
      |                 ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  cin>>N>>M;
  vector<vector<int64_t>>A(3,vector<int64_t>(N));
  for(int i=0;i<N;i++){
  cin>>A.at(0).at(i);
    cin>>A.at(1).at(i);
    cin>>A.at(2).at(i);
   }int64_t ans=0;
  for(int bit=0;bit<(1<<3);bit++){
  vector<int64_t>B(N);
    for(int i=0;i<N;i++)
      int64_t x=A.at(0).at(i);
      int64_t y=A.at(1).at(i);
      int64_t z=A.at(2).at(i);
      int64_t b=x+y+z;
    for(int j=0;j<3;j++){
  if(bit&(1<<j))
    b-=2*get<j>(T);
  } B.at(i)=b;
    } sort(B.begin(),B.end());
    reverse(B.begin(),B.end());
    int64_t pos=0;
    for(int k=0;k<M;k++)
      pos+=B.at(k);
    if(ans<pos)
      ans=pos;
  }cout<<ans<<endl;
     return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:28: error: 'i' was not declared in this scope
   16 |       int64_t y=A.at(1).at(i);
      |                            ^
a.cc:18:17: error: 'x' was not declared in this scope
   18 |       int64_t b=x+y+z;
      |                 ^
a.cc:21:17: error: 'T' was not declared in this scope
   21 |     b-=2*get<j>(T);
      |                 ^
a.cc:23:12: error: 'B' was not declared in this scope
   23 |     } sort(B.begin(),B.end());
      |            ^
a.cc: At global scope:
a.cc:30:4: error: 'cout' does not name a type
   30 |   }cout<<ans<<endl;
      |    ^~~~
a.cc:31:6: error: expected unqualified-id before 'return'
   31 |      return 0;
      |      ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

n,m=map(int,input().split())
a=[]
for i in range(n):
    a.append([int(i) for i in input().split()])
maxn=0
for i in range(8):
    vec=[]
    for j in range(n):
        s=0
        for k in range(3):
            if(int(i/(1<<k))%2==0):
                s+=a[j][k]
            else:
                s-=a[j][k]
        vec.append(s)
    ans=0
    vec.sort(reverse=True)
    for j in range(m):
        ans+=vec[j]
    maxn=max(maxn,ans)
print(maxn)

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


import java.util.*;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();

		long x[] = new long[n];
		long y[] = new long[n];
		long z[] = new long[n];

		for(int i=0; i<n; i++) {
			x[i]=sc.nextLong();
			y[i]=sc.nextLong();
			z[i]=sc.nextLong();
		}

		long ans = 0;
		for(int i=0; i<8; i++) {
			long s1 = 1;long s2 = 1;long s3 = 1;
			if((i>>1&1)==1) s1=-1;
			if((i>>2&1)==1) s2=-1;
			if((i>>3&1)==1) s3=-1;
			ArrayList<Long> sum = new ArrayList<Long>();
			for(int j=0; j<n; j++) {
				sum.add(s1*x[j] + s2*y[j] + s3*z[j]);
			}
			Collections.sort(sum, Collections.reverseOrder());
			long tmp=0;
			for(int j=0; j<m; j++) {
				tmp += sum.get(j);
			}
			ans = Math.max(ans, tmp);
		}
		System.out.println(ans);
		sc.close();
	}


}


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