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

	int N;
  	int temp;	
  	int tempCounter;
  	int answerCounter=0;
  		
  
  	cin >> N;
  
  	for (int i = 0; i < N; i++) {
	  
      temp = i + 1;
      tempCounter = 0;
      
      while(true){
      	if (temp % 2 != 0 ) break;
        
        else {
          temp = temp * 0.5;
          tempCounter++;
        }
      }
      
      if (answerCounter <= tempCounter ) { answerCounter = tempCounter; }
      
    }
  	
	cout << answerCounter << endl;
  	return 0;	

Compiler output:
a.cc:7:9: error: 'cin' does not name a type
    7 |         cin >> N;
      |         ^~~
a.cc:9:9: error: expected unqualified-id before 'for'
    9 |         for (int i = 0; i < N; i++) {
      |         ^~~
a.cc:9:25: error: 'i' does not name a type
    9 |         for (int i = 0; i < N; i++) {
      |                         ^
a.cc:9:32: error: 'i' does not name a type
    9 |         for (int i = 0; i < N; i++) {
      |                                ^
a.cc:27:9: error: 'cout' does not name a type
   27 |         cout << answerCounter << endl;
      |         ^~~~
a.cc:28:9: error: expected unqualified-id before 'return'
   28 |         return 0;
      |         ^~~~~~
Language: C++

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

int main(){
	int N;
	cin >> N;
	for(int k=0; k<7; k++){
		if(2^k <= N < 2^(k+1) ){
			int ans = 2^k;
		} 
	cout << ans << endl;	
	}
	

	


} 



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

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

int main(){
	int N;
	cin >> N;
	for(int k=0; k<7; k++){
		if(2^k <= N < 2^(k+1) ) cout << int 2^k << endl; 
	}
	

	


} 



Compiler output:
a.cc: In function 'int main()':
a.cc:11:49: error: expected primary-expression before 'int'
   11 |                 if(2^k <= N < 2^(k+1) ) cout << int 2^k << endl;
      |                                                 ^~~
Language: C++

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

int main(){
	int N;
	cin >> N;
	for(int k=0; k<7; k++){
		if(2^k <= N < 2^(k+1) ) cout << pow(2, int k) << endl; 
	}
	

	


} 



Compiler output:
a.cc: In function 'int main()':
a.cc:11:56: error: expected primary-expression before 'int'
   11 |                 if(2^k <= N < 2^(k+1) ) cout << pow(2, int k) << endl;
      |                                                        ^~~
Language: C++

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

int main(){
	int N;
	cin >> N;
	for(int k=0; k<7; k++){
		if(2^k <= N < 2^(k+1) ) cout << 2**k << endl; 
	}
	

	


} 



Compiler output:
a.cc: In function 'int main()':
a.cc:10:51: error: invalid type argument of unary '*' (have 'int')
   10 |                 if(2^k <= N < 2^(k+1) ) cout << 2**k << endl;
      |                                                   ^~
Language: C++

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

int main(){
	int N;
	cin >> N;
	for(int k=0; k<7; k++){
		if(2^k <= N < 2^(k+1) ) cout << 2^k << endl; 
	}
	

	


} 



Compiler output:
a.cc: In function 'int main()':
a.cc:10:53: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   10 |                 if(2^k <= N < 2^(k+1) ) cout << 2^k << endl;
      |                                                   ~~^~~~~~~
Language: C++

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

int main(){
	int N;
	cin >> N;
	for(int k=0; k<7; k++){
		if(2**k <= N < 2**(k+1) ) cout << k << endl; 
	}
	

	


} 



Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: invalid type argument of unary '*' (have 'int')
   10 |                 if(2**k <= N < 2**(k+1) ) cout << k << endl;
      |                      ^~
a.cc:10:34: error: invalid type argument of unary '*' (have 'int')
   10 |                 if(2**k <= N < 2**(k+1) ) cout << k << endl;
      |                                  ^~~~~~
Language: C++



fn main() {
    let n: u32 = read();
    let mut p = 1;
    while p <= n {
        p *= 2;
    }
    println!("{}", p/2);
}

// 以下関数


use std::io::*;
use std::str::FromStr;
pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub const MOD: u64 = 1_000_000_007;

pub fn is_prime(n: i32) -> bool {
    if n < 2 {
        return false;
    } else if n == 2 {
        return true;
    }
    let mut i = 2;
    while i * i < n {
        if n % i == 0 {
            return false;
        } else {
            i += 1;
            continue;
        }
    }
    true
}

pub fn lcm(mut n: i32, mut m: i32) -> i32 {
    n = if n > m { m } else { n };
    m = if n > m { n } else { m };
    let mut i = n;
    while i % m != 0 {
        i += n;
    }
    i
}

pub fn abs(n: i32) -> i32 {
    if n >= 0 {
        n
    } else {
        -n
    }
}

pub fn max(n: i32, m: i32) -> i32 {
    if n >= m {
        n
    } else {
        m
    }
}

pub fn min(n: i32, m: i32) -> i32 {
    if n <= m {
        n
    } else {
        m
    }
}

pub fn factorial(n: u32) -> u32 {
    if n == 0 {
        return 1
    }
    let mut r = n;
    for i in 0..n-1{
        r *= n-i-1;
    }
    r
}

pub fn combination(n: u32, m: u32) -> u32 {
    factorial(n) / factorial(m) / factorial(n-m)
}

Compiler output:
a.cc:88:14: error: too many decimal points in number
   88 |     for i in 0..n-1{
      |              ^~~~
a.cc:3:1: error: 'fn' does not name a type
    3 | fn main() {
      | ^~
a.cc:15:1: error: 'use' does not name a type
   15 | use std::io::*;
      | ^~~
a.cc:16:1: error: 'use' does not name a type
   16 | use std::str::FromStr;
      | ^~~
a.cc:17:1: error: 'pub' does not name a type
   17 | pub fn read<T: FromStr>() -> T {
      | ^~~
a.cc:29:1: error: 'pub' does not name a type
   29 | pub const MOD: u64 = 1_000_000_007;
      | ^~~
a.cc:31:1: error: 'pub' does not name a type
   31 | pub fn is_prime(n: i32) -> bool {
      | ^~~
a.cc:49:1: error: 'pub' does not name a type
   49 | pub fn lcm(mut n: i32, mut m: i32) -> i32 {
      | ^~~
a.cc:59:1: error: 'pub' does not name a type
   59 | pub fn abs(n: i32) -> i32 {
      | ^~~
a.cc:67:1: error: 'pub' does not name a type
   67 | pub fn max(n: i32, m: i32) -> i32 {
      | ^~~
a.cc:75:1: error: 'pub' does not name a type
   75 | pub fn min(n: i32, m: i32) -> i32 {
      | ^~~
a.cc:83:1: error: 'pub' does not name a type
   83 | pub fn factorial(n: u32) -> u32 {
      | ^~~
a.cc:94:1: error: 'pub' does not name a type
   94 | pub fn combination(n: u32, m: u32) -> u32 {
      | ^~~
Language: C

#include <stdio.h>
#include <string.h>
int main(void){
int count=1;
int n;
scanf("%d",&n);
for(;;){
count=count*2;
if(count>n){printf("%d",count/2);break;}

}
}
return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: 'i' was not declared in this scope
   19 |   cout << i << endl;
      |           ^
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 max = 1;
    
    for (int i = 0; i < N; i++){
      max = Math.pow(2, i);
      if (max > N){
        break;
      }
    }
    
    max = max / 2;
    System.out.println(max);
  }
}


Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from double to int
      max = Math.pow(2, i);
                    ^
1 error
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 max = 1;
    
    for (int i = 0; i < N; i++){
      max = 2**i;
      if (max > N){
        break;
      }
    }
    
    max = max / 2;
    System.out.println(max);
  }
}


Compiler output:
Main.java:10: error: illegal start of expression
      max = 2**i;
              ^
1 error
Language: C++

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

int main(){
    int N;
    cin >> N;
    
    int i = 0;
    int n = 1;
    while (true){
        n *= 2;
        if (n >= N){
            break;
        }
        i += 1;
    }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:17:6: error: expected '}' at end of input
   17 |     }
      |      ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main() {
    int N,n = 2,count = 0;
    cin >>N;
    for(int i=0;i<N;i++){
        if(i == n){
            count++;
            n *=2;
            }
        }
        
    }
    cout << count <<endl;
}

Compiler output:
a.cc:17:5: error: 'cout' does not name a type
   17 |     cout << count <<endl;
      |     ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

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

int main() {
    int N,max = 0;
    for(int i=0;i<N;i++){
        int count = 0;
        while(i%2 == 0){
            count++;
            i = i/2;
        }

        if(count<max)max = count;
    }
    cout << max <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout << max <<endl;
      |     ^~~~
      |     std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |     cout << max <<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>
#include <vector>
using namespace std;

int breaknumber(int n){
    int count = 0;
    while(){
        if(n%2 == 0){
            count++;
            n = n/2;
        }
        else break;
    }
    return count;
}


int main(){
    int N,max = 0;
    cin >> N;
    for(int i=0;i<N;i++){
        if(max < breaknumber(i))max = breaknumber(i);
    }
    cout << max <<endl;
}

Compiler output:
a.cc: In function 'int breaknumber(int)':
a.cc:7:11: error: expected primary-expression before ')' token
    7 |     while(){
      |           ^
Language: C++

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

int breaknumber(int n;){
    int count = 0;
    while(){
        if(n%2 == 0){
            count++;
            n = n/2;
        }
        else break;
    }
    return count;
}


int main(){
    int N,max = 0;
    cin >> N;
    for(int i=0;i<N;i++){
        if(max < breaknumber(i))max = breaknumber(i);
    }
    cout << max <<endl;
}

Compiler output:
a.cc:5:22: error: expected ')' before ';' token
    5 | int breaknumber(int n;){
      |                ~     ^
      |                      )
a.cc:5:23: error: expected unqualified-id before ')' token
    5 | int breaknumber(int n;){
      |                       ^
Language: C++

#include <iostream>
using namespace std;

int N;
     

int main() {
    
    cin >> N;

    int res = 1;


    while (true) {
        if (i < N)  res = res * 2;
        else cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         if (i < N)  res = res * 2;
      |             ^
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

N = int(input())
num_list = [64, 32, 16, 8, 4, 2]

for i in num_list:
  if N>=i:
    print(i)
    exit(0)

print(0)

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

#include<iostream>

int main () {
  int N;
  std::cin >> N;
  out = 1;
  while (out*2 < N+1) {
    out *= 2;
  }
  std::cout << out << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'out' was not declared in this scope
    6 |   out = 1;
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  
  int a = 1;
  while(true){
      if(a > N ) flag = true;
      if(flag) break;
    
      a *= 2
  }
  cout << a << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'flag' was not declared in this scope
    9 |       if(a > N ) flag = true;
      |                  ^~~~
a.cc:10:10: error: 'flag' was not declared in this scope
   10 |       if(flag) break;
      |          ^~~~
a.cc:12:13: error: expected ';' before '}' token
   12 |       a *= 2
      |             ^
      |             ;
   13 |   }
      |   ~
Language: C++

#include <iostream>
#include <vector>

int main(){

  int n;  std::cin >> n;
  std::vector<int> numbers(n, 1);
  for(int i=0; i < numbers.size(); i++) numbers.at(i) += i;
  
  int answer = 1;
  int power = 0;
  for(int i=0; i < numbers.size(); i++){
    int dividend = numbers.at(i);
    int count = 0;
    
    while(dividend % 2 == 0){
      count++;
      dividend /= 2;
    }
    
    if(power < count){
      power = count;
      answer = numbers.at(i)
    }
    
  }
  
  std::cout << answer << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:29: error: expected ';' before '}' token
   23 |       answer = numbers.at(i)
      |                             ^
      |                             ;
   24 |     }
      |     ~
Language: C++

using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
 
int main(){
int n;
  cin >> n;
  int k=0;
  //if(n==1)cout << 1 << endl;
  for(;;){
    if(n<=pow(2,k)){cout << k << endl;return 0;}
    k++;
  }
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   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:11: error: 'pow' was not declared in this scope
   10 |     if(n<=pow(2,k)){cout << k << endl;return 0;}
      |           ^~~
a.cc:10:21: error: 'cout' was not declared in this scope
   10 |     if(n<=pow(2,k)){cout << k << endl;return 0;}
      |                     ^~~~
a.cc:10:21: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:34: error: 'endl' was not declared in this scope
   10 |     if(n<=pow(2,k)){cout << k << endl;return 0;}
      |                                  ^~~~
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 <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  
  int a;
  for(int i = 1;i <= N;i++){
    if(i >= 2 && i< 4){
       a = 2;
    }else if(i >=4 && i<8){
      a = 4;
    }else if(i >=8 && i < 16){
      a = 8;
    }else if(i >= 16 && i < 32){
      a = 32;
    }else if(i == 1){
      a = 1;
    }else{
      a = 64
    }
  }
  cout << a << endl;
}

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

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

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:8: error: 'x' was not declared in this scope
    9 |     if(x%2==0){
      |        ^
a.cc:12:5: error: expected primary-expression before '}' token
   12 |     }
      |     ^
a.cc:11:13: error: expected ')' before '}' token
   11 |       while(
      |            ~^
      |             )
   12 |     }
      |     ~        
a.cc:12:5: error: expected primary-expression before '}' token
   12 |     }
      |     ^
a.cc:13:4: error: expected '}' at end of input
   13 |   }
      |    ^
a.cc:3:7: note: to match this '{'
    3 | main(){
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
map<int,int> diviosr(int n){
  map<int,int> mp;
  for(int p=2;p*p<=n;++p){
    while(n%p==0){
      mp[p]++;
      n/=p;
    }
  }
  return mp;
}
main(){
  int n;
  cin>>n;
  int ans=0;
  for(int i=0;i<=n;++i){
    auto div = divisor(i);
    ans=max(ans,div[2]);
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:18:16: error: 'divisor' was not declared in this scope; did you mean 'diviosr'?
   18 |     auto div = divisor(i);
      |                ^~~~~~~
      |                diviosr
Language: C++

#include<bits/stdc++.h>
using namespace std;
map<int,int> diviosr(int n){
  map<int,int> mp;
  for(int p=2;p*p<=n){
    while(n%p==0){
      mp[p]++;
      n/=p;
    }
  }
  return mp;
}
main(){
  int n;
  cin>>n;
  int ans=0;
  for(int i=0;i<=n;++i){
    auto div = divisor(i);
    ans=max(ans,div[2]);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'std::map<int, int> diviosr(int)':
a.cc:5:21: error: expected ';' before ')' token
    5 |   for(int p=2;p*p<=n){
      |                     ^
      |                     ;
a.cc: At global scope:
a.cc:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:18:16: error: 'divisor' was not declared in this scope; did you mean 'diviosr'?
   18 |     auto div = divisor(i);
      |                ^~~~~~~
      |                diviosr
Language: C++

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

Compiler output:
a.cc:23:2: error: stray '#' in program
   23 | }#include <bits/stdc++.h>
      |  ^
a.cc:23:3: error: 'include' does not name a type
   23 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:25:5: error: redefinition of 'int n'
   25 | int n,mn=0,sum=0;
      |     ^
a.cc:3:5: note: 'int n' previously declared here
    3 | int n,mn=0,sum=0;
      |     ^
a.cc:25:7: error: redefinition of 'int mn'
   25 | int n,mn=0,sum=0;
      |       ^~
a.cc:3:7: note: 'int mn' previously defined here
    3 | int n,mn=0,sum=0;
      |       ^~
a.cc:25:12: error: redefinition of 'int sum'
   25 | int n,mn=0,sum=0;
      |            ^~~
a.cc:3:12: note: 'int sum' previously defined here
    3 | int n,mn=0,sum=0;
      |            ^~~
a.cc:26:5: error: redefinition of 'int main()'
   26 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int N;

int main(){
  cin >> N;

  int shou = 0;
  for(int i = N;N > 0; N--)
  {
    int res = 0;
    int n = N;
    while(n){
      if(n % 2 != 0) break;
      n /= 2;
      ++res;
    }
    
    if(shou < res) shou = res;
  }
  
  int seikai = 1;
  for(int i = 0;i < shou; i++){
  	seikai = seikai * 2;
  }
  cout << seikai << endl;
}
#include <iostream>
using namespace std;

int N;

int main(){
  cin >> N;

  int shou = 0;
  for(int i = N;N > 0; N--)
  {
    int res = 0;
    int n = N;
    while(n){
      if(n % 2 != 0) break;
      n /= 2;
      ++res;
    }
    
    if(shou < res) shou = res;
  }
  
  int seikai = 1;
  for(int i = 0;i < shou; i++){
  	seikai = seikai * 2;
  }
  cout << seikai << endl;
}


Compiler output:
a.cc:32:5: error: redefinition of 'int N'
   32 | int N;
      |     ^
a.cc:4:5: note: 'int N' previously declared here
    4 | int N;
      |     ^
a.cc:34:5: error: redefinition of 'int main()'
   34 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

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

int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i*=2);
	cout<<i/2<<endl;
	return 0;		
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'i' was not declared in this scope
    9 |         cout<<i/2<<endl;
      |               ^
Language: C++

#include <iostream>
using namespace std;

float N;         
int res = 0;
int main() {
    cin >> N;
    for (int i = 0; N < 1; ++i){
      
     N = N / 2
       
      res++;
    }

    

    

    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected ';' before 'res'
   10 |      N = N / 2
      |               ^
      |               ;
   11 | 
   12 |       res++;
      |       ~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
	int n;
	scanf_s("%d",&n);
	if(n!=0){
		int m_num=0;
		int m_time=0;
		for(int i=n;i>0;i--){
			if(i%2==0){
				int cnt=0;
				int mem=i;
				int flag=-1;
				while(mem%2==0){
					mem/=2;
					cnt++;
				}

				if(mem!=1)	flag=0;
				else{
					flag=1;
				}

				if(cnt>m_time){
					m_time=cnt;
					m_num=i;
				}
				else if(cnt==m_time){
					if(flag==1){
						m_time=cnt;
						m_num=i;
					}
				}
			}
		}
		printf("%d\n",m_num);
	}
	return 0;
}

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

#include <stdio.h>
#include <stdlib.h>
int main(){
	int n;
	scanf_s("%d",&n);
	if(n!=0){
		int m_num=0;
		int m_time=0;
		for(int i=n;i>0;i--){
			if(i%2==0){
				int cnt=0;
				int mem=i;
				while(mem%2==0){
					mem/=2;
					cnt++;
				}

				if(cnt>m_time){
					m_time=cnt;
					m_num=i;
				}

			}
		}
		printf("%d\n",m_num);
	}
	return 0;
}

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

#include<stdio.h>
int main(){
    if(n>=64)printf("64");
    if(n>=32&&n<64)printf("32");
    if(n>=16&&n<32)printf("16");
    if(n>=8&&n<16)printf("8");
    if(n>=4&&n<8)printf("4");
    if(n>=2&&n<4)printf("2");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:8: error: 'n' undeclared (first use in this function)
    3 |     if(n>=64)printf("64");
      |        ^
main.c:3:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
    if(n>=64)printf("64");
    if(n>=32&&n<64)printf("32");
    if(n>=16&&n<32)printf("16");
    if(n>=8&&n<16)printf("8");
    if(n>=4&&n<8)printf("4");
    if(n>=2&&n<4)printf("2");
    if(n==1)printf("0");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:8: error: 'n' undeclared (first use in this function)
    3 |     if(n>=64)printf("64");
      |        ^
main.c:3:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
	int n;
	scanf_s("%d",&n);
	int m_num=0;
	int m_time=0;
	for(int i=n;i>0;i--){
		if(i%2==0){
			int cnt=0;
			int mem=i;
			while(mem%2==0){
				mem/=2;
				cnt++;
			}
			if(mem==1){
				if(cnt>m_time){
					m_time=cnt;
					m_num=i;
				}
			}
		}
	}
	printf("%d\n",m_num);
	return 0;
}

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

#include<stdio.h>
int n;
void pai(int a[],int &l)
{
	int o=a[0];
	for(int p=0;p<n;p++)
	{
		if(a[p]>o) 
		{
			o=a[p];
			l=p;}
	}
}

int main()
{

	scanf("%d",&n);
	int a[100],k=0,b[100];
	for(int i=1;i<n;i++)
	{
		int j=i; int m=0;
		while(j%2==0)
		{
			j=j/2;m++;}
		a[k]=m;
		b[k]=i;k++;
	}
	int l;
	pai(a,l);
	printf("%d",b[l]);
	return 0;
}




Compiler output:
main.c:3:22: error: expected ';', ',' or ')' before '&' token
    3 | void pai(int a[],int &l)
      |                      ^
main.c: In function 'main':
main.c:30:9: error: implicit declaration of function 'pai' [-Wimplicit-function-declaration]
   30 |         pai(a,l);
      |         ^~~
Language: C

#include<stdio.h>
int n;
int pai(int a[],int &l)
{
	int o=a[0];
	for(int p=0;p<n;p++)
	{
		if(a[p]>o) 
		{
			o=a[p];
			l=p;}
	}
return l;}

int main()
{

	scanf("%d",&n);
	int a[100],k=0,b[100];
	for(int i=1;i<n;i++)
	{
		int j=i; int m=0;
		while(j%2==0)
		{
			j=j/2;m++;}
		a[k]=m;
		b[k]=i;k++;
	}
	int l;
	pai(a,l);
	printf("%d",b[l]);
	return 0;
}




Compiler output:
main.c:3:21: error: expected ';', ',' or ')' before '&' token
    3 | int pai(int a[],int &l)
      |                     ^
main.c: In function 'main':
main.c:30:9: error: implicit declaration of function 'pai' [-Wimplicit-function-declaration]
   30 |         pai(a,l);
      |         ^~~
Language: C

#include<iostream>
using namespace std;
int main()
{
	int a;
	cin>>a;
	if(a==1)cout<<"1"<<endl;
	else if(2<=a&&a<4)cout<<"2"<<endl;
	else if(4<=a&&a<8)cout<<"4"<<endl;
	else if(8<=a&&a<16)cout<<"8"<<endl;
	else if(16<=a&&a<32)cout<<"16"<<endl;
	else if(32<=a&&a<64)cout<<"32"<<endl;
	else if(64<=a)cout<<"64"<<endl;
	return 0;
}

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

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

int main() {
  int a;
  cin >> a;
 
  
 
 
  if (a < 2){
    cout <<"1" <<endl;
  }
  else if(a<4){
    cout << "2" << endl;
  }
  else if(a<8)[
    cout <<"4" <<endl;
    }
    else if(a<16){
      cout <<"8" <<endl;
    }
    else if(a<32){
      cout <<"16"<<endl;
    }
    else if(a<64){
      cout <<"32"<<endl;
    }
else{
  cout <<"64" <<endl;
}
    }
      
       
     
   

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: warning: capture of variable 'std::cout' with non-automatic storage duration
   18 |     cout <<"4" <<endl;
      |     ^~~~
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:63:18: note: 'std::ostream std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:9: error: expected ',' before '<<' token
   18 |     cout <<"4" <<endl;
      |         ^~~
      |         ,
a.cc:18:10: error: expected identifier before '<<' token
   18 |     cout <<"4" <<endl;
      |          ^~
a.cc:18:22: error: expected ']' before ';' token
   18 |     cout <<"4" <<endl;
      |                      ^
      |                      ]
a.cc: In lambda function:
a.cc:18:22: error: expected '{' before ';' token
a.cc: At global scope:
a.cc:20:5: error: expected unqualified-id before 'else'
   20 |     else if(a<16){
      |     ^~~~
a.cc:23:5: error: expected unqualified-id before 'else'
   23 |     else if(a<32){
      |     ^~~~
a.cc:26:5: error: expected unqualified-id before 'else'
   26 |     else if(a<64){
      |     ^~~~
a.cc:29:1: error: expected unqualified-id before 'else'
   29 | else{
      | ^~~~
a.cc:32:5: error: expected declaration before '}' token
   32 |     }
      |     ^
Language: C++

#include<bit/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  int ans=1;
while(ans<=n){
  ans<<=1;
}
  ans>>=1;
  cout<<ans<<endl;
}

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

#include<iostream>

using namespace std;

int main()

{
int N;
  cin >>N;
  cout <<(N%2==0?N:(N-1)<<endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   10 |   cout <<(N%2==0?N:(N-1)<<endl;
      |                    ~~~~~^~~~~~
a.cc:10:31: error: expected ')' before ';' token
   10 |   cout <<(N%2==0?N:(N-1)<<endl;
      |          ~                    ^
      |                               )
Language: C++

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

int main(){
    int n;
    cin>>n;
    int m=1;
    while(m<=n){
        m*=2;
    }
    m/=2;
    cout<<m<<endl;
}
return 0;
}

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:39: error: 'sun' was not declared in this scope; did you mean 'sum'?
   14 |                                 cout<<sun/2<<endl;
      |                                       ^~~
      |                                       sum
Language: C++

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'while'
   11 |     while(a%2==0){
      |     ^~~~~
Language: C++

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

int main() {
  int N; cin >> N;
  int ans = 0;
  int M = 0;
  for (int i = 1; i <= N; i++) {
    int n = i;
    int c = 0;
    while (n % 2 == 0) {
      n /= 2;
      c++;
    }
    if (count > M) {
      M = c;
      ans = i;
    }
  }
  count << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
   15 |     if (count > M) {
      |         ~~~~~~^~~
a.cc:20:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   20 |   count << ans << endl;
      |   ~~~~~~^~~~~~
Language: C++

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

int main() {
  int N; cin >> N;
  int ans = 0;
  int M = 0;
  for (int i = 1; i <= N; i++) {
    int n = i
    int c = 0;
    while (n % 2 == 0) {
      n /= 2;
      c++;
    }
    if (count > M) {
      M = c;
      ans = i;
    }
  }
  count << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'int'
   10 |     int c = 0;
      |     ^~~
a.cc:13:7: error: 'c' was not declared in this scope
   13 |       c++;
      |       ^
a.cc:15:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
   15 |     if (count > M) {
      |         ~~~~~~^~~
a.cc:16:11: error: 'c' was not declared in this scope
   16 |       M = c;
      |           ^
a.cc:20:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   20 |   count << ans << endl;
      |   ~~~~~~^~~~~~
Language: C++

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

int main() {
  int N; cin >> N;
  int ans = 0;
  int max_count = 0;
  for (int i = 1; i <= N; i++) {
    int number = i
    int count = 0;
    while (number % 2 == 0) {
      number /= 2;
      count++;
    }
    if (count > max_count) {
      max_count = count;
      ans = i;
    }
  }
  count << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'int'
   10 |     int count = 0;
      |     ^~~
a.cc:13:12: error: no post-increment operator for type
   13 |       count++;
      |            ^~
a.cc:15:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>'
   15 |     if (count > max_count) {
      |         ~~~~~~^~~~~~~~~~~
a.cc:16:19: error: cannot resolve overloaded function 'count' based on conversion to type 'int'
   16 |       max_count = count;
      |                   ^~~~~
a.cc:20:9: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   20 |   count << ans << endl;
      |   ~~~~~~^~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;cin>>N;int res=0;int tmp = 1;
  while(true){tmp*=2;if(tmp>N)break;res++;}
  cout<<2**res<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: invalid type argument of unary '*' (have 'int')
    6 |   cout<<2**res<<endl;
      |           ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;cin>>N;int res=0;int tmp = 1;
  while(true){tmp*=2;if(tmp>N)break;else res++}
  cout<<res<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:47: error: expected ';' before '}' token
    5 |   while(true){tmp*=2;if(tmp>N)break;else res++}
      |                                               ^
      |                                               ;
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;cin>>N;res=0;
  while(true){if(N%2==1)break;else{N/=2;res++;}}
  cout<<res<<endl;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
 
int main() {
    int n;
    cin >> n;
  　if(n>=64){
     cout<<64<<endl;
   }
  else if(n>=32){
    cout<<32<<endl;
  }
  else if(n>=16){
    cout<<16<<endl;
  }
  else if(n>=8){
    cout<<8<<endl;
  }
  else if(n>=4){
    cout<<4<<endl;
  }
  else if(n>=2){
    cout<<2<<endl;
  }
}

Compiler output:
a.cc:9:3: error: extended character 　 is not valid in an identifier
    9 |   　if(n>=64){
      |   ^
a.cc: In function 'int main()':
a.cc:9:3: error: '\U00003000if' was not declared in this scope
    9 |   　if(n>=64){
      |   ^~~~
a.cc:12:3: error: 'else' without a previous 'if'
   12 |   else if(n>=32){
      |   ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;cin>>N;
  
  if (N>=64) A=64;
  else if (N>=32) A=32;
  else if (N>=16) A=16;
  else if (N>=8) A=8;
  else if (N>=4) A=4;
  else if (N>=2) A=2;
  else A=0;
  
  cout<<A<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'A' was not declared in this scope
    7 |   if (N>=64) A=64;
      |              ^
a.cc:8:19: error: 'A' was not declared in this scope
    8 |   else if (N>=32) A=32;
      |                   ^
a.cc:9:19: error: 'A' was not declared in this scope
    9 |   else if (N>=16) A=16;
      |                   ^
a.cc:10:18: error: 'A' was not declared in this scope
   10 |   else if (N>=8) A=8;
      |                  ^
a.cc:11:18: error: 'A' was not declared in this scope
   11 |   else if (N>=4) A=4;
      |                  ^
a.cc:12:18: error: 'A' was not declared in this scope
   12 |   else if (N>=2) A=2;
      |                  ^
a.cc:13:8: error: 'A' was not declared in this scope
   13 |   else A=0;
      |        ^
a.cc:15:9: error: 'A' was not declared in this scope
   15 |   cout<<A<<endl;
      |         ^
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int max = sc.nextInt();
        boolean isEven = true;
        count = 10000;
        newCount = 0;

        while(isEven) {
            isEven = true;
            newCount = 0;
            for (int i = 1; i <= max; i++) {
                if (i % 2 == 0) {
                    i = i / 2;
                } else {
                    isEven = false;
                }
            }
            if(count > newCount) {
                count = newCount;
            }
        }
        System.out.println(count);
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
        count = 10000;
        ^
  symbol:   variable count
  location: class Main
Main.java:9: error: cannot find symbol
        newCount = 0;
        ^
  symbol:   variable newCount
  location: class Main
Main.java:13: error: cannot find symbol
            newCount = 0;
            ^
  symbol:   variable newCount
  location: class Main
Main.java:21: error: cannot find symbol
            if(count > newCount) {
               ^
  symbol:   variable count
  location: class Main
Main.java:21: error: cannot find symbol
            if(count > newCount) {
                       ^
  symbol:   variable newCount
  location: class Main
Main.java:22: error: cannot find symbol
                count = newCount;
                ^
  symbol:   variable count
  location: class Main
Main.java:22: error: cannot find symbol
                count = newCount;
                        ^
  symbol:   variable newCount
  location: class Main
Main.java:25: error: cannot find symbol
        System.out.println(count);
                           ^
  symbol:   variable count
  location: class Main
8 errors
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tuple>
#include <map>
#include <queue>
#include <set>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define mod 1000000007
#define fst first
#define pb push_back

int calc(int x){
    int cnt = 0;
    while(x % 2 == 0){
        x /= 2;
        cnt++;
    }
    return cnt;
}

int main()
{
    int N;
    cin >> N;
    vector<int> W(N);
    int ans = 0;
    for(int i = 1; i <= N; i++){
        W[i] = calc(i);
    }
    sort(w.begin,w.end(), greater<int>());
    cout << W[0] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:10: error: 'w' was not declared in this scope
   34 |     sort(w.begin,w.end(), greater<int>());
      |          ^
Language: C++

stream>
using namespace std ;

int main(){
  int N,Max,i,j ;

  cin >> N ;
  int counter[N],A[N],m_A[N] ;

  for(i=0;i<=N-1;i++){
    A[i] = i+1 ;
    m_A[i] = A[i] ;
    counter[i]=0 ;
  }

  for(i=0;i<=N-1;i++){
    while(A[i]%2==0){
      counter[i]++ ;
      A[i] = A[i]/2 ;
    }
  }

  for(i=0;i<=N-1;i++){
    if(counter[0] <= counter[i]){
      counter[0] = counter[i] ;
      m_A[0] = m_A[i] ;
      Max = m_A[i] ;
    }else{
      Max = m_A[0] ;
    }
  }

  cout << Max << endl ;
}

Compiler output:
a.cc:1:1: error: 'stream' does not name a type
    1 | stream>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> N ;
      |   ^~~
a.cc:33:3: error: 'cout' was not declared in this scope
   33 |   cout << Max << endl ;
      |   ^~~~
a.cc:33:18: error: 'endl' was not declared in this scope
   33 |   cout << Max << endl ;
      |                  ^~~~
Language: C

stream>
using namespace std ;

int main(){
  int N,Max,i,j ;

  cin >> N ;
  int counter[N],A[N],m_A[N] ;

  for(i=0;i<=N-1;i++){
    A[i] = i+1 ;
    m_A[i] = A[i] ;
    counter[i]=0 ;
  }

  for(i=0;i<=N-1;i++){
    while(A[i]%2==0){
      counter[i]++ ;
      A[i] = A[i]/2 ;
    }
  }

  for(i=0;i<=N-1;i++){
    if(counter[0] <= counter[i]){
      counter[0] = counter[i] ;
      m_A[0] = m_A[i] ;
      Max = m_A[i] ;
    }else{
      Max = m_A[0] ;
    }
  }

  cout << Max << endl ;
}

Compiler output:
main.c:1:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token
    1 | stream>
      |       ^
main.c: In function 'main':
main.c:7:3: error: 'cin' undeclared (first use in this function)
    7 |   cin >> N ;
      |   ^~~
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:3: error: 'cout' undeclared (first use in this function); did you mean 'counter'?
   33 |   cout << Max << endl ;
      |   ^~~~
      |   counter
main.c:33:18: error: 'endl' undeclared (first use in this function)
   33 |   cout << Max << endl ;
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;

    if (n < 2)
    {
        cout << 0;
        return;
    }

    int v = 1;
    while (true)
    {
        if (v * 2 > n)
        {
            break;
        }
        v *= 2;
    }
    cout << v;
}

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

#include <iostream>
// #include <string>
// #include <vector>
// #include <algorithm> // to use min_element

using namespace std;


int main(){
	int i=0, n;
	cin >>n;
	while ((int)pow(2.0,  i)<n){
		i++;
	}
	cout << (int) pow(2.0, i-1);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'pow' was not declared in this scope
   12 |         while ((int)pow(2.0,  i)<n){
      |                     ^~~
a.cc:15:23: error: 'pow' was not declared in this scope
   15 |         cout << (int) pow(2.0, i-1);
      |                       ^~~
Language: C++

#include <iostream>
// #include <string>
#include <math>
// #include <vector>
// #include <algorithm> // to use min_element

using namespace std;


int main(){
	int i=0, n;
	cin >>n;
	while (pow(2,  i)<n){
		i++;
	}
	cout << pow(2, i-1);
return 0;
}

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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm> // to use min_element

using namespace std;


int main(){
	int i=0, n;
	cin >>n;
	while (pow(2,  i)<n){
		i++;
	}
	cout << pow(2, i-1);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'pow' was not declared in this scope
   12 |         while (pow(2,  i)<n){
      |                ^~~
a.cc:15:17: error: 'pow' was not declared in this scope
   15 |         cout << pow(2, i-1);
      |                 ^~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int> countList;
  for(int i = 0; i < n; i++){
    int data = i + 1;
    int count = 0;
    while(data % 2 == 0){
      data /= 2;
      count++;
    }
    countList.push_back(count);
  }
  
  auto iter = max_element(x.begin(), x.end());
  size_t index = distance(x.begin(), iter);
  
  cout << index << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: 'x' was not declared in this scope
   20 |   auto iter = max_element(x.begin(), x.end());
      |                           ^
Language: C++

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

int main(){
  int n
  cin >> n;
  vector<int> countList;
  for(int i = 0; i < n; i++){
    int data = i + 1;
    int count = 0;
    while(data % 2 == 0){
      data /= 2;
      count++;
    }
    countList.push_back(count);
  }
  
  auto iter = max_element(x.begin(), x.end());
  size_t index = distance(x.begin(), iter);
  
  cout << index << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'cin'
    8 |   cin >> n;
      |   ^~~
a.cc:10:22: error: 'n' was not declared in this scope
   10 |   for(int i = 0; i < n; i++){
      |                      ^
a.cc:20:27: error: 'x' was not declared in this scope
   20 |   auto iter = max_element(x.begin(), x.end());
      |                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int ni(int x){
  int cnt=0;
  while(x%2==0){
    x/=2;
    cnt++;
  }
  return cnt;
}
int main(){
  int n;
  cin>>n;
  int cnt=0; int ans;
  for(int i=1;i<=n;i++){
    if(cnt<=ni(i)){
      cnt=ni(i);
      ans=i;
    }
  cout<<ans<<endl;
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int ni(int x){
  int cnt=0;
  while(x%2==0){
    x/=2;
    cnt++;
  }
  return cnt;
}
int main(){
  int n;
  cin>>n;
  int ans=0;
  for(int i=1;i<=n;i++)if(ans<ni(i))ans=n(i);
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:42: error: 'n' cannot be used as a function
   24 |   for(int i=1;i<=n;i++)if(ans<ni(i))ans=n(i);
      |                                         ~^~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N;
    cin >> N;
    for(int i = 1; i < count; i *= 2) {
        if(i > N) {
            cout << i / 2 << endl;
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:22: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   36 |     for(int i = 1; i < count; i *= 2) {
      |                    ~~^~~~~~~