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

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int N[] = sc.nextInt();
        int A[] = new int[N];
        int count = 0;
        for(int i =0; i < N; i++){
            A[i] = sc.nextInt();
        }
        while(A[i]%2 == 0){
            A[i] = A[i]/2;
            count += 1;
        }
        System.out.println(count);
    }
}


Compiler output:
Main.java:7: error: incompatible types: int cannot be converted to int[]
        int N[] = sc.nextInt();
                            ^
Main.java:8: error: incompatible types: int[] cannot be converted to int
        int A[] = new int[N];
                          ^
Main.java:10: error: bad operand types for binary operator '<'
        for(int i =0; i < N; i++){
                        ^
  first type:  int
  second type: int[]
Main.java:13: error: cannot find symbol
        while(A[i]%2 == 0){
                ^
  symbol:   variable i
  location: class Main
Main.java:14: error: cannot find symbol
            A[i] = A[i]/2;
              ^
  symbol:   variable i
  location: class Main
Main.java:14: error: cannot find symbol
            A[i] = A[i]/2;
                     ^
  symbol:   variable i
  location: class Main
6 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();
       int[] a = new int[N];
       for(int i = 0; i < N; ++i) {
           a[i] = sc.nextInt();
       }
       
       int max = 0; 
       int[] b = new int[N];
       
       for (int i = 0; i < N; ++i){
           if(a[i] % 2 == 0) {
               b[i] = A[i] / 2;
           ++max;
           }
       }
       System.out.println(max);
    }
}

Compiler output:
Main.java:18: error: cannot find symbol
               b[i] = A[i] / 2;
                      ^
  symbol:   variable A
  location: class Main
1 error
Language: Java

public class Main {
    public static void main(String args[]) {
       //値の取得
       Scanner sc = new Scanner(System.in);
       int N = sc.nextInt();
       int[] A = new int[N];
       int max = 0; //繰り返すことができる最大回数
       int tmp = 0;    //操作するAの値を格納する変数
       
       for(int i = 0; i < N; ++i) {
           A[i] = sc.nextInt();
           
           //操作可能な回数分繰り返す
           tmp = A[i];
           while(A[i] % 2 == 0) {
               tmp = A[i] / 2;
               ++max;
           }
       }
       
       //出力
       System.out.println(max);
    }

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

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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;

int cnt(ll a){
    int p=0;
    while(a%2==0){
        a/=2;
        p++;
    }
    return p;
}
int main(){
   int n, ans = 0;
   cin >> n;
   int ans = 0;
   rep(i, 0, n){
       ll q;
       cin >> q;
       ans += cnt(q);
   }
   cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:8: error: redeclaration of 'int ans'
   33 |    int ans = 0;
      |        ^~~
a.cc:31:11: note: 'int ans' previously declared here
   31 |    int n, ans = 0;
      |           ^~~
Language: C++

#include <iostream>
using namespace std;
int main (){
  int n, x=0, amari=0;
  long long int a[10009];
  cin>>n;
  for(int i=0; i<n; i++){
    cin>>a[i];
  }
  for(int j=0; j<n; j++){
      amari=a[j]%2;
      cout<<a[j];
      while(amari==0){
        a[j]=a[j]/2;x++;
      }else{
        break;
      }
    }
  }
  cout<<x<<endl;
  cout<<a[4];
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 'else' without a previous 'if'
   15 |       }else{
      |        ^~~~
a.cc: At global scope:
a.cc:20:3: error: 'cout' does not name a type
   20 |   cout<<x<<endl;
      |   ^~~~
a.cc:21:3: error: 'cout' does not name a type
   21 |   cout<<a[4];
      |   ^~~~
a.cc:22:3: error: expected unqualified-id before 'return'
   22 |   return 0;
      |   ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
int main (){
  int n, x=0, amari=0;
  long long int a[n];
  for(int i=0; i<<10; i++){
    cin>>a[i];
  }
  for(i=0; i<<10; i++){
    for(int j=0; j<<30; j++){
      amari=a[i]%2
      if(amari==0){
        a[i]=a[i]/2;
        x++;
      }else{
        break;
      }
    }
  }
  cout<<x<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0; i<<10; i++){
      |       ^
a.cc:15:8: error: 'else' without a previous 'if'
   15 |       }else{
      |        ^~~~
Language: Java

import java.util.Scanner;

public class C_4 {
	public static void mains(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int[] array = new int[n];
		for(int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		}
		int ans = 0;
		for(int i = 0; i < n; i++) {
			if(array[i] % 2 == 0) ans += 2;
			else ans++;
		}
		System.out.println(ans);
	}
}


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

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

int func(int x){
  if(x%2 != 0)
    return 0;
  return func(x/2) + 1;
}

int main(){
  int n;
  cin >> n;
  int ans = 0;
  
  for(int i = 0; i < n; i++){
    int a;
    cin >> a;
    ans += func(a);
  }
  
  cout << ans << sndl;
  
  return 0;
  
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: 'sndl' was not declared in this scope
   21 |   cout << ans << sndl;
      |                  ^~~~
Language: C++

n = int(input())
A = list(map(int,input().split()))
ans = 0

for i in A:
    while i % 2 == 0:
        i /= 2
        ans += 1
            
print(ans)

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

#include <iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    int sum=0;
    vector<int> a(n);
    for (int i=0;i<n;++i) cin >> a[i];
  
	for (int i=0;i<n;i++){
		while (a[i] % 2 == 0){
          a[i] /= 2; 
          sum++;
        }
	}
	cout << sum << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> a(n);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> a(n);
      |            ^~~
a.cc:9:34: error: 'a' was not declared in this scope
    9 |     for (int i=0;i<n;++i) cin >> a[i];
      |                                  ^
a.cc:12:24: error: 'a' was not declared in this scope
   12 |                 while (a[i] % 2 == 0){
      |                        ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    int n;
  	cin >> n;
    int sum=0;
    vector<int> a(n);
    for (int i=0;i<n;++i) cin >> a[i];
  
	for (int i=0;i<n;i++){
		while (a[i] % 2 == 0){
          a[i] /= 2; 
          sum++;
        }
	}
	cout << sum << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> a(n);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> a(n);
      |            ^~~
a.cc:9:34: error: 'a' was not declared in this scope
    9 |     for (int i=0;i<n;++i) cin >> a[i];
      |                                  ^
a.cc:12:24: error: 'a' was not declared in this scope
   12 |                 while (a[i] % 2 == 0){
      |                        ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    int n;
  	cin >> n;
    int sum=0;
    vector<int> a(n);
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		while (a[i] % 2 == 0){
          a[i] /= 2; 
          sum++;
        }
	}
	cout << sum << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> a(n);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> a(n);
      |            ^~~
a.cc:10:24: error: 'a' was not declared in this scope
   10 |                 cin >> a[i];
      |                        ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    int n
    int sum=0;
	cin >> n;
    vector<int> a(n);
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		while (a[i] % 2 == 0){
          a[i] /= 2; 
          sum++;
        }
	}
	cout << sum << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'int'
    6 |     int sum=0;
      |     ^~~
a.cc:7:16: error: 'n' was not declared in this scope
    7 |         cin >> n;
      |                ^
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> a(n);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> a(n);
      |            ^~~
a.cc:10:24: error: 'a' was not declared in this scope
   10 |                 cin >> a[i];
      |                        ^
a.cc:13:11: error: 'sum' was not declared in this scope
   13 |           sum++;
      |           ^~~
a.cc:16:17: error: 'sum' was not declared in this scope
   16 |         cout << sum << endl;
      |                 ^~~
Language: C++

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,j,n) for(int i = j; i < n; i++)
#define RFOR(i,j,n) for(int i = j-1; i >= n; i--)
#define PREC(n) fixed << setprecision(n)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; } value
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define _LIBCPP_DEBUG 0
using namespace std;
int64_t MOD = 1000000007;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int64_t n, sum;
  cin >> n;
  vector<int> a(n);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    while (a[i] % 2 == 0) { a[i] /= 2; sum++; }
  }r
  cout << sum << endl;
  return 0;
}
//templete by private_yusuke

Compiler output:
a.cc: In function 'int main()':
a.cc:69:4: error: 'r' was not declared in this scope
   69 |   }r
      |    ^
Language: C

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

int main()
{
    int n;
    cin >> n;
    int cnt = 0;
    int tmp;
    for(int i = 0; i < n; i++){
        cin >> tmp;
        while(tmp % 2 == 0){
            tmp /= 2;
            cnt++;
        }
    }

    cout << cnt << endl;
}

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

def resolve():
  n = int(input())
  ans = 0
  a = list(map(int, input().split()))
  for v in a:
    while v%2 == 0:
      v //= 2
      ans += 1
  print(ans)
  return

if __name__ == "__main__":
  resolve()


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def resolve():
      | ^~~
Language: C++

#include<iostream>
int n,a[10000],sum;
int main(void){
  std::cin>>n;
  for(int loop=0;loop<=n;loop++){
    std::cin>>a[loop];
    while(a[loop]%2==0){
      a[loop]/=2;
      sum++;
    }
  }
  std::cout<<sum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |   std::cout<<sum<<endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
int n,a[10000],sum;
int main(void){
  cin>>n;
  for(int loop=0;loop<=n;loop++){
    cin>>a[loop];
    while(a[loop]%2==0){
      a[loop]/=2;
      sum++;
    }
  }
  cout<<sum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin>>n;
      |   ^~~
      |   std::cin
In file included 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:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   cout<<sum<<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:12:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |   cout<<sum<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected ';' before ')' token
   11 |     for(int j=0; j++){
      |                     ^
      |                     ;
Language: C++

count=gets.to_i
line=gets.chomp.split(" ").map(&:to_i)
sum=0
line.each do |l|
  tmp=0
  while l %2==0
    tmp +=1
    l /= 2
  end
  sum +=tmp
end  
puts sum

Compiler output:
a.cc:1:1: error: 'count' does not name a type
    1 | count=gets.to_i
      | ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,count;
  count = 0;
  cin >> N;
  vector<int> vec(N);
  for(int i = 0; i < N; i++){
    while(vec.at(j) % 2 ==0){
      count += 1;
      vec.at(j) /= 2;
    }
  }
  cout << count << endl;
      
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'j' was not declared in this scope
   10 |     while(vec.at(j) % 2 ==0){
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,count;
  count = 0;
  cin >> N;
  vector<int> vec(N);
  for(int i = 0; i < N; i++){
    while(vec.at(i) % 2 ==0){
      count += 1;
      vec.at(j) / 2;
    }
  }
  cout << count << endl;
      
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'j' was not declared in this scope
   12 |       vec.at(j) / 2;
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,count;
  count = 0;
  cin >> N;
  vector<int> vec(N);
  for(int i = 0; i < N; i++){
    while(vec.at(j) % 2 ==0){
      count += 1;
      vec.at(j) / 2;
    }
  }
  cout << count << endl;
      
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'j' was not declared in this scope
   10 |     while(vec.at(j) % 2 ==0){
      |                  ^
Language: Java

import java.util.*;
import java.util.function.BiPredicate;
import java.util.function.BinaryOperator;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int inputN = Integer.parseInt(sc.next());
        sc.nextLine();
        List<Integer> arr = Arrays.asList(sc.nextLine().split(" ")).stream().map( (String x) -> Integer.parseInt(x)).collect(Collectors.toList());

        int count = 0;
        int sum = arr.stream().mapToInt(x ->{
            char[] str = new StringBuffer(Integer.toBinaryString(x)).reverse().toString().toCharArray();
            int cnt = 0;
            for(int i = 0; i<str.length; i++ ) {
                if (str[i] == '0') {
                    cnt++;
                } else {
                    break;
                }
            }
            return cnt;
        }).sum();
        System.out.println(sum);

    }


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'sum' was not declared in this scope
   11 |      a[i] /= 2; sum++;
      |                 ^~~
a.cc:14:11: error: 'sum' was not declared in this scope
   14 |   cout << sum << endl;
      |           ^~~
Language: C++

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

int func(ll N){
  int count = 0;
  while(N%2==0){ N/=2; count++;}
  return count;
}

int main(){
  int N; cin>>N;
  ll a;
  int num = 0;
  REP(i,N){
    cin >> a;
    num += func(a);
  }
  printf("%d\n",num);  
}


Compiler output:
a.cc:5:10: error: 'll' was not declared in this scope
    5 | int func(ll N){
      |          ^~
a.cc: In function 'int main()':
a.cc:13:3: error: 'll' was not declared in this scope
   13 |   ll a;
      |   ^~
a.cc:16:12: error: 'a' was not declared in this scope
   16 |     cin >> a;
      |            ^
a.cc:17:16: error: 'func' cannot be used as a function
   17 |     num += func(a);
      |            ~~~~^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
    int n;
    int A;
    int ans=0;
    cin >>n;
    for (int i=0;i<n;i++){
        cin >>A;
        while(A%2==0){
            A/=2
            ans++;
        }
        cout <<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: expected ';' before 'ans'
   12 |             A/=2
      |                 ^
      |                 ;
   13 |             ans++;
      |             ~~~  
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>

using namaspace std;

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

  int div_num = 0;
  for (int i = 0; i < N; ++i)
  {
    int a;
    cin >> a;

    //奇数になるまで割り続ける
    while (a % 2 == 0)
    {
      a = a / 2;
      ++div_num;
    }
  }
  cout << div_num << endl;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namaspace'
    3 | using namaspace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> N;
      |   ^~~
      |   std::cin
In file included 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:22:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |   cout << div_num << 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:22:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |   cout << div_num << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

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

  int div_num = 0;
  for (int i = 0; i < N; ++i)
  {
    int a;
    cin >> a;

    //奇数になるまで割り続ける
    while (a % 2 == 0)
    {
      a = a / 2;
      ++div_num;
    }
  }
  cout << div_num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |   cout << div_num << 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:20:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |   cout << div_num << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

  int div_num = 0;
  for (int i = 0; i < N; ++i)
  {
    int a;
    cin >> a;

    //奇数になるまで割り続ける
    while (a % 2 == 0)
    {
      a = a / 2;
      ++div_num;
    }
  }
  cout << div_num << endl;
}

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

package main

import (
    "bufio"
    "fmt"
    "os"
)

func bicnt(x int) int {
  cnt := 0
  for x > 0 && x % 2 == 0 {
    cnt++
    x /= 2
  }
  return cnt
}

func main() {
    r := bufio.NewReader(os.Stdin)
    w := bufio.NewWriter(os.Stdout)
    defer w.Flush()

    var n int
    fmt.Fscan(r, &n)
    ans := 0
    for i := 0; i < n; i++ {
      var a int
      fmt.Fscan(r, &a)
      ans += bicnt(a)
    }
    fmt.Fprintln(w, ans)
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:18:1: error: 'func' does not name a type
   18 | func main() {
      | ^~~~
Language: C++

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

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


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

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    ll power = 0;
    for(int i=0;i<n;i++) 
	{
    	long long m;
        cin>>m;
        while(m%2==0) 
		{
            power++;
            m /= 2;
        }
    }
    cout << power << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'll' was not declared in this scope
    6 |     ll power = 0;
      |     ^~
a.cc:13:13: error: 'power' was not declared in this scope
   13 |             power++;
      |             ^~~~~
a.cc:17:13: error: 'power' was not declared in this scope
   17 |     cout << power << endl;
      |             ^~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector <int> a;
a.size(N);
  for(int i=0;i<N;i++){
    cin>>a.at(i);}
  int count,b = 0;
  while (a.at(b) > 0) {
    // 2で割り切れなければループを抜ける
    if(b>=N){
      break ;}
    if (a.at(b) % 2 > 0) {
      b++;
      
    }
    a.at(b) = a.at(b) / 2;
    count++;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: no matching function for call to 'std::vector<int>::size(int&)'
    8 | a.size(N);
      | ~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:992:7: note: candidate: 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]'
  992 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/stl_vector.h:992:7: note:   candidate expects 0 arguments, 1 provided
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector <int> a;
a.size()=N;
  for(int i=0;i<N;i++){
    cin>>a.at(i)}
  int count,b = 0;
  while (a.at(b) > 0) {
    // 2で割り切れなければループを抜ける
    if(b>=N){
      break ;}
    if (a.at(b) % 2 > 0) {
      b++;
      
    }
    a.at(b) = a.at(b) / 2;
    count++;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: lvalue required as left operand of assignment
    8 | a.size()=N;
      | ~~~~~~^~
a.cc:10:17: error: expected ';' before '}' token
   10 |     cin>>a.at(i)}
      |                 ^
      |                 ;
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector <int> a;
a.size=N;
  for(int i=0;i<N;i++){
    cin>>a.at(i)}
  int count,b = 0;
  while (a.at(b) > 0) {
    // 2で割り切れなければループを抜ける
    if(b>=N)
      break ;
    if (a.at(b) % 2 > 0) {
      b++;
      
    }
    a.at(b) = a.at(b) / 2;
    count++;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
    8 | a.size=N;
      | ~~^~~~
      |       ()
a.cc:10:17: error: expected ';' before '}' token
   10 |     cin>>a.at(i)}
      |                 ^
      |                 ;
Language: C++

#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<queue>
using namespace std;
#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
typedef pair<int, int>P;
const int INF = 1e8;

int f(int num) {
	int cnt = 0;
	while (1) {
		if (num % 2 == 0) {
			cnt++;
			num /= 2;
		}
		else break;
	}
	return cnt;
}

signed main() {
	int N;
	cin >> N;
	int num;
	int ans = 0;
	rep(i, N) {
		cin >> num;
		ans += f(num);
	}
	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'cin' was not declared in this scope
   28 |         cin >> N;
      |         ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<queue>
  +++ |+#include <iostream>
    6 | using namespace std;
a.cc:35:9: error: 'cout' was not declared in this scope
   35 |         cout << ans;
      |         ^~~~
a.cc:35:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int N;
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
	}
	
	int answer = 0;
	for (int i = 0; i < N; i++)
	{
		// 3倍操作は何回でもできるので、2で割る操作を1回行った回数を計算する
		while(A[i] % 2 == 0)
		{
			A[i] /= 2;
			answer++;
		}
	}
	
	cout << answer << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: 'A' was not declared in this scope
   12 |                 cin >> A[i];
      |                        ^
a.cc:19:23: error: 'A' was not declared in this scope
   19 |                 while(A[i] % 2 == 0)
      |                       ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  int count = 0;
  for (int i = 0; i < N; i++){
    cin >> a.at(i);
    for (int i = 0; i < 50){
      if (a.at(i) % 2 == 0){
        count++;
        a.at(i) /= 2;
      }
      else break;
    }
  }
  cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: expected ';' before ')' token
   11 |     for (int i = 0; i < 50){
      |                           ^
      |                           ;
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   
   int[] ai = new int[N];
   for(int i=0;i<N;i++) ai[i]=sc.nextInt();

   int count =0;
   for(int i=0;i<30;i++)
   {
     if(ai[i]%2==0)
     {
        ai[i] /=2;
        count++;
     }
   }

   else System.out.println(count);
 }
}

Compiler output:
Main.java:20: error: 'else' without 'if'
   else System.out.println(count);
   ^
1 error
Language: C++

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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
// #define int long long
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { return a * b / GCD(a, b); }

const int dy[] = {0, 1, 0, -1, -1, 1, 1, -1};
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};

inline bool inside(int y, int x, int H, int W) {
    return (y >= 0 && x >= 0 && y < H && x < W);
}

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

signed main()
{
  int n; cin>>n;
  vi a(n);
  rep(i,n) cin>>a[i];
  ll ans=0;
  rep(i,n){
    if(a[i]%2==0)ans+=a[i]/2;
  }
  cou<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:3: error: 'cou' was not declared in this scope; did you mean 'cos'?
   59 |   cou<<ans<<endl;
      |   ^~~
      |   cos
Language: C++

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
A = np.array(read().split(),np.int32)

answer = 0
for _ in range(32):
    A = A[A%2 == 0]
    answer += len(A)
    A >>= 1
print(answer)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

	vector<int> a;
	for (int i = 0; i < n; i++)
	{
		int tmp;
		cin >> tmp;
		if (tmp % 2 == 0)
		{
			a.push_back(tmp);
		}
	}

	if (a.size == 0)
	{
		cout << 0 << endl;
	}
	else
	{
		sort(a.begin(), a.end());
		int i = 0;
		int ans = 0;
		while (true)
		{
			if (a.at(i) % 2 == 0 && a.at(i) != 0)
			{
				a.at(i) /= 2;
				ans++;
			}
			else
			{
				i++;
			}
			if (i == a.size())
			{
				break;
			}
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   21 |         if (a.size == 0)
      |             ~~^~~~
      |                   ()
Language: C++

#include<iostream>
using namespace std;
int main()
{
int legth,a;
int count=0;
cin >> length;
while(cin >>a){
  if(a%2==0){
    a=a/2;
    count++;
    }
  else a=3*a;
  return 0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 'length' was not declared in this scope; did you mean 'legth'?
    7 | cin >> length;
      |        ^~~~~~
      |        legth
Language: C++

#include<iostream>
using namespace std;
int main()
{
int legth,a;
int count=0;
cin >> length;
while(cin >>a){
  if(a%2==0){
    a=a/2;
    count++;
  } 
  else a=3*a;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 'length' was not declared in this scope; did you mean 'legth'?
    7 | cin >> length;
      |        ^~~~~~
      |        legth
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include <iostream>
using namespace std;

int main(void)
{
    int m,n,o=0,i,j,k;
    int sum=0,range=0;
    double ans=0.0,half;
    //long long int m,n,o,i,j,k=0;
    //vector <int> v;
    //float f,g,h;
    char c,d;
    //string a;
    cin>>m>>n>>o;
    half=m*m*n/2;
    if(o==half)
    {
        cout<<"45.0000000000";
    }
    else
    {
        ans=atan(2*(2*half-o)/(m*m*m))*180/PI;
        if(o<half)
            ans=90-ans;
        cout<<ans;
    }
    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: 'atan' was not declared in this scope
   22 |         ans=atan(2*(2*half-o)/(m*m*m))*180/PI;
      |             ^~~~
a.cc:22:44: error: 'PI' was not declared in this scope
   22 |         ans=atan(2*(2*half-o)/(m*m*m))*180/PI;
      |                                            ^~
Language: C++

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

#define rep1(i, a, n) for (int i = a; i < n; i++)
#define rep2(i, a, n) for (int i = n; i >= a; i--)
#define asc(v) sort(v.begin(), v.end())
#define desc(v) sort(v.begin(), v.end(), greater<int>())

using namespace std;

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

Compiler output:
a.cc:24:1: error: 'cout' does not name a type
   24 | cout << ans << endl;
      | ^~~~
a.cc:25:1: error: expected unqualified-id before 'return'
   25 | return 0;
      | ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

using namespace std;
#define rep(i,n) for( int i = 0 ; i < n ; i++ )
typedef long long ll ;
int main() {
  
  int N ;
  int M ;
  cin >> N  ;
  int ans = 0 ;
  vector<int> A(N) ;
  rep(i,N) cin >> A.at(i) ;
  rep(i,N){
      while( A.at(i)%2 == 0 && A.at(i) != 0 ){
        ans++ ;
        A.at(i) = A.at(i)/2 ; 
  	}
  }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> N  ;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   vector<int> A(N) ;
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> A(N) ;
      |          ^~~
a.cc:11:19: error: 'A' was not declared in this scope
   11 |   rep(i,N) cin >> A.at(i) ;
      |                   ^
a.cc:13:14: error: 'A' was not declared in this scope
   13 |       while( A.at(i)%2 == 0 && A.at(i) != 0 ){
      |              ^
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout << ans << endl;
      |     ^~~~
a.cc:18:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:20: error: 'endl' was not declared in this scope
   18 |     cout << ans << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  int N,a,count = 0,max = -1;
  cin >> N;
  for(int i = 0;i < N;++i){
    cin >> a
    while(a > 0){
      if(a%2 == 0)count++;
      a /= 2;
    }
    if(max < count)max = count;
  }

  cout << max << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected ';' before 'while'
    8 |     cin >> a
      |             ^
      |             ;
    9 |     while(a > 0){
      |     ~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main{
  int n; cin>>n;
  int cnt = 0;
  for(int i = 0; i < n; i++){
    int x; cin>>x;
    while(x%2 == 0){
      cnt++;
      x/=2;
    }
  }
  cout<<cnt<<"\n";
  return 0;
}

Compiler output:
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main{
      |     ^~~~
a.cc:6:3: error: expected primary-expression before 'int'
    6 |   int n; cin>>n;
      |   ^~~
a.cc:6:3: error: expected '}' before 'int'
a.cc:5:9: note: to match this '{'
    5 | int main{
      |         ^
a.cc:6:10: error: 'cin' does not name a type
    6 |   int n; cin>>n;
      |          ^~~
a.cc:8:3: error: expected unqualified-id before 'for'
    8 |   for(int i = 0; i < n; i++){
      |   ^~~
a.cc:8:18: error: 'i' does not name a type
    8 |   for(int i = 0; i < n; i++){
      |                  ^
a.cc:8:25: error: 'i' does not name a type
    8 |   for(int i = 0; i < n; i++){
      |                         ^
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout<<cnt<<"\n";
      |   ^~~~
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

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

int main(){
  int n,ans=0;
  cin >> n;
  rep(i,n)  cin >> a[i];

  rep(i,n){
    while(a[i]%2==0){
      a[i]/=2;
      ans++;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 'a' was not declared in this scope
   13 |   rep(i,n)  cin >> a[i];
      |                    ^
a.cc:16:11: error: 'a' was not declared in this scope
   16 |     while(a[i]%2==0){
      |           ^
Language: C++

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

int main() {
  int64_t n;
  cin>>n;
  vector<int64_t> a(n);
  for(int i=0;i<n;i++){
    cin>>a.at(i);
  }
  int64_t count=0;
  for(int i=;i<n;i++){
    if(a.at(i)%2==0){
      while(a.at(i)%2==0){
        a.at(i)/=2;
        count++;
      }
    }
  }
  cout<<count;
}


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

#include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <cmath>
#include <queue>
#include <ctime>
#include <utility> // std::pair
#include <functional> // std::greater <int> ()
#define int long long
#define inf 1000000000000000001
#define BASE 29 // hashings mod, can be rand'd
#define mod 998244353 // can be 1000000007
#define pi 3.1415926535897
#define pii pair <int, int>
#define fii first
#define see second

typedef long long ll;
typedef long double ld;
using namespace std;

int a, cnt=0;
int tmp;

// functions
void input(){
	cin >> n;
	return;
}

void solve(){
	for(int i=1; i<=n; i++){
		cin >> tmp;
		while(tmp%2==0){
			cnt++;
			tmp/=2;
		}
	}
	return;
}

void output(){
	cout << tmp;
	return;
}

signed main(){
/*
//  REMEMBER TO TURN OFF IFDEF IN PROBLEMS WITH FILE I/O
*/
//#ifdef sheeep
//	freopen("forces.inp", "r", stdin);
//	freopen("forces.out", "w", stdout);
//#endif
	ios_base::sync_with_stdio(false);
//	int t;
//	cin >> t;
//	for(int i=1; i<=t; i++){
		input();
		solve();
		output();
//	}
	return 0;
}
// Author: NamSPro



Compiler output:
a.cc: In function 'void input()':
a.cc:31:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   31 |         cin >> n;
      |                ^
      |                yn
a.cc: In function 'void solve()':
a.cc:36:25: error: 'n' was not declared in this scope
   36 |         for(int i=1; i<=n; i++){
      |                         ^
Language: C++

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

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

    vector<int> vec(n);

    for (int i = 0; i<n ; i++) 
    {
        cin >> vec.at(i);
    }

    int result = 0;
    for (int i = 0; i < n; i++) {
        int dec = 2;
        while (vec[i] % dec == 0){
            dec = dec * 2;
            result++;
        }
    }

    cout << result << endl;
}

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

#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
int a;
int c=0;
cin>>a;
vector<int> b(a);
for(int i=0;i<a;i++)
cin>>b.at(i);
for(int i=0;i<a;i++)
for(int j=0;j<1000000000;i++)
	if(b.at(i)%2==0){
		b.at(i)/=2;
		c++;
	}
	else
		break;
}
cout<<c;
}


Compiler output:
a.cc:20:1: error: 'cout' does not name a type
   20 | cout<<c;
      | ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

import time
import sys
sys.setrecursionlimit(10000)


n = int(input())
a = list(map(int, input().split()))

start = time.time()

ans = 0
for i in range(n):
    while a[i] % 2 == 0:
        a[i] //= 2
        ans += 1

print(ans)

elapsed_time = time.time() - start
#print ("{:.2f}".format(elapsed_time * 1000) + " [msec]")



    

Compiler output:
a.cc:20:2: error: invalid preprocessing directive #print
   20 | #print ("{:.2f}".format(elapsed_time * 1000) + " [msec]")
      |  ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import time
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main()
{
    array<int, 10000> arr;
    int n;
    cin >> n;
    int size = 0;
    for (int i=0; i < n; ++i)
    {
        int x;
        cin >> x;
        if (x%2 == 0)
        {
            arr[size++] = x;
        }
    }

    sort(arr.data(), arr.data()+size);

    int count = 0;
    while (size > 0)
    {
        int& temp = arr[size-1];
        auto* end = arr.data() + size - 1;
        do
        {
            temp >>= 1;
            for_each(arr.data(), end, [](int& x) { x *= 3; });
            ++count;
        } while (temp%2 == 0 && temp > 0);
        --size;
    }
    cout << count << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |     sort(arr.data(), arr.data()+size);
      |     ^~~~
      |     short
a.cc:31:13: error: 'for_each' was not declared in this scope
   31 |             for_each(arr.data(), end, [](int& x) { x *= 3; });
      |             ^~~~~~~~
Language: C++

#include<iostream>
using namespace std;


int func(int x){
  if(x%2 != 0) return 0;
  return func(x/2) + 1
}


int main(){
  int N, a;
  cin >> N;
  int cnt = 0;
  for(int i=0; i<N; i++){
    cin >> a;
    cnt += func(a);
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int func(int)':
a.cc:7:23: error: expected ';' before '}' token
    7 |   return func(x/2) + 1
      |                       ^
      |                       ;
    8 | }
      | ~
Language: C++

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

int main()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    ll sum = 1;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        sum *= a[i];
    }
    int cnt = 0;
    while(!sum % 2){
        cnt++;
        sum %= 2;
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'll' was not declared in this scope
    9 |     vector<ll> a(n);
      |            ^~
a.cc:9:14: error: template argument 1 is invalid
    9 |     vector<ll> a(n);
      |              ^
a.cc:9:14: error: template argument 2 is invalid
a.cc:10:7: error: expected ';' before 'sum'
   10 |     ll sum = 1;
      |       ^~~~
      |       ;
a.cc:12:17: error: invalid types 'int[int]' for array subscript
   12 |         cin >> a[i];
      |                 ^
a.cc:13:9: error: 'sum' was not declared in this scope
   13 |         sum *= a[i];
      |         ^~~
a.cc:13:17: error: invalid types 'int[int]' for array subscript
   13 |         sum *= a[i];
      |                 ^
a.cc:16:12: error: 'sum' was not declared in this scope
   16 |     while(!sum % 2){
      |            ^~~
Language: Java


import java.util.Arrays;
import java.util.Scanner;

public class DoisOrTres {

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

		int a = sc.nextInt();
		sc.nextLine();
		int[] vet = new int[a];

		int b = 0;
		for (int i = 0; i < a; i++) {
			b = sc.nextInt();
			vet[i] = b;
		}

		int conte = 0;
		while(true) {
			boolean entrou = false;
			for(int i = 0; i<a; i++) {
				if(!entrou && vet[i] % 2 == 0) {
					entrou = true;
					vet[i] = vet[i]/2;
					conte += 1;	
				}else {
					vet[i] = vet[i]*3;
				}
			}
			if(!entrou) {
				System.out.println(conte);
				break;
			}
			
		}
		
	}

}

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