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


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


int main() {
	int N;
	cin >> N;
	int max_count = 0;

	for (int i = 1; i < N+1; ++i) {
	
		int i1 = i;
		int count = 0;

		while (true) {

			bool flg = false;

			if (i1 == 0 || i1 == 1) break;

			if (i1 % 2 != 0) {
				flg = true;
			}
			
			if (flg) break;

			i1= i1 / 2;
			count += 1;

			if (max_count < count) {
				max_count = count;
			}
		}
		
	}
	cout << pow(2 , max_count) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:17: error: 'pow' was not declared in this scope
   38 |         cout << pow(2 , max_count) << endl;
      |                 ^~~
Language: C++

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

int main() {
  int n; cin >> n;
  for(int i=0;i<n;i++) {
    if(power(2,i)>n) {
      cout << power(2,i-1) << endl;
      break;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 'power' was not declared in this scope
    7 |     if(power(2,i)>n) {
      |        ^~~~~
Language: C++

using System;
class BreakNumber
{
  static void Main(){
  	var a=int.Parse(Console.ReadLine());
    int b,c=0;
    for(b=0;b<=6;b++)if(a>=(int)Math.Pow((double)2,(double)b))c=(int)Math.Pow((double)2,(double)b);
    Console.Write("{0}",c);
  }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:10:2: error: expected ';' after class definition
   10 | }
      |  ^
      |  ;
a.cc: In static member function 'static void BreakNumber::Main()':
a.cc:5:9: error: 'var' was not declared in this scope
    5 |         var a=int.Parse(Console.ReadLine());
      |         ^~~
a.cc:7:25: error: 'a' was not declared in this scope
    7 |     for(b=0;b<=6;b++)if(a>=(int)Math.Pow((double)2,(double)b))c=(int)Math.Pow((double)2,(double)b);
      |                         ^
a.cc:7:33: error: 'Math' was not declared in this scope
    7 |     for(b=0;b<=6;b++)if(a>=(int)Math.Pow((double)2,(double)b))c=(int)Math.Pow((double)2,(double)b);
      |                                 ^~~~
a.cc:8:5: error: 'Console' was not declared in this scope
    8 |     Console.Write("{0}",c);
      |     ^~~~~~~
Language: C++

using System;
class BreakNumber
{
  static void Main(){
  	var a=int.Parse(Console.ReadLine());
    int b,c=0;
    for(b=0;b<=6;b++)if(a>=(int)Math.Pow(2,b))c=(int)Math.Pow(2,b);
    Console.Write("{0}",c);
  }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:10:2: error: expected ';' after class definition
   10 | }
      |  ^
      |  ;
a.cc: In static member function 'static void BreakNumber::Main()':
a.cc:5:9: error: 'var' was not declared in this scope
    5 |         var a=int.Parse(Console.ReadLine());
      |         ^~~
a.cc:7:25: error: 'a' was not declared in this scope
    7 |     for(b=0;b<=6;b++)if(a>=(int)Math.Pow(2,b))c=(int)Math.Pow(2,b);
      |                         ^
a.cc:7:33: error: 'Math' was not declared in this scope
    7 |     for(b=0;b<=6;b++)if(a>=(int)Math.Pow(2,b))c=(int)Math.Pow(2,b);
      |                                 ^~~~
a.cc:8:5: error: 'Console' was not declared in this scope
    8 |     Console.Write("{0}",c);
      |     ^~~~~~~
Language: C++

int main() {
    int N,cnt;
    cin >> N;
    int maxnum=0,maxcnt=0;
    for (int i=N;i>0;i--) {
        cnt = 0;
        int num = i;
        while (true) {
            cnt++;
            if (num%2) break;
            num /= 2;
        }
        if (cnt > maxcnt) {
            maxcnt = cnt;
            maxnum = i;
        }
    }
    cout << maxnum << endl;
}

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

#include <iostream>
#include <cstdio>

using namespace std;

int main(){
    int n;
    cin >> n;
    for(int i=6;i>=0;i--)
    {
        if(pow(2,i)<=n)
        {
            cout<<pow(2,i)<<endl;
            return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: 'pow' was not declared in this scope
   11 |         if(pow(2,i)<=n)
      |            ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int a,b=1,c=1;
  cin>>a;
  for(int i=0;i<8;i++){
    b*=2
    if(a>b)
      c=b;
  }
  cout<<c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected ';' before 'if'
    8 |     b*=2
      |         ^
      |         ;
    9 |     if(a>b)
      |     ~~
Language: C++

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

int main(){
    int n,m=0,c=0;
    cin>>n;
    for(int i=1;i=<n;i++){
        for(int j=i;;j>>=1){
            if(j%2!=0) break;
            c++;
        }
        m=max(m,c);
        c=0;
    }
    return 0;
}

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

// template
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<long long, long long> LP;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define REP_AB(i, a, b) for (int i = int(a); i <= int(b); ++i)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(ALL(v))
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)), v.end());
#define SIZE(x) ((ll)(x).size())
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a / gcd(a, b)) * b;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
#define out cout
#define in cin
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
// template end


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;
    in >> n;
    ll ans = 1;
    REP(i, 8){
        if (pow(2, i) < n){
            ans = pow(2, i)
        }
    }
    out << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:28: error: expected ';' before '}' token
   34 |             ans = pow(2, i)
      |                            ^
      |                            ;
   35 |         }
      |         ~
Language: C++

#include<stdio.h>
int main(void)
{
	int n,j,i,s;
	scanf("%d",&n);
	s=0;
	for(i=1;i<=n;i++){
		while(i%2==0){
			i=i/2;
			j=j+1;
		}
		if(j>s){
			i=s;
		}
	}
	printf("%d\n",s);
	return 0;


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

#include <iostream>
using namespace std;

int main(){
  int N,count=0;cin >> N;
  while(N%2==0){
    count++;
  }
  cout << count <<endl;
}


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

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

int main() {
	int n,c=0;

	cin >> n;
	while (true) {
		if (n < pow(2, c)) {
			break;
		}
		c++;
	}

	cout << pow(2, c - 1) << endl;
}


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

#include"stdafx.h"

#include <iostream>
# include<string>

using namespace std;
int waru(int N, int kaisuu);

int main() {
	int N;
	int max=0;
	int kekka=0;

	cin >> N;
	
	for (int i = 1; i <= N; i++) {
		int kaisuu = 0;
		kaisuu = waru(i, kaisuu);
		if (max < kaisuu) {
			max = kaisuu;
			kekka = i;
		}
	}

	cout << kekka << endl;
}

int waru(int N, int kaisuu) {
	if (N % 2 != 0) {
		return kaisuu;
	}
	
	kaisuu = waru(N/2, kaisuu);
	kaisuu++;
	return kaisuu;
}

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(x) sort(x.begin(),x.end())
#define REVE(x) reverse(x.begin(),x.end())
#define all(x) (x).begin(),(x).end()
#define fst first
#define mp make_pair
#define pb push_back
using LL = long long;
using ULL = unsigned long long;
#define FOR(i, m, n) for(int i = m;i < n;i++)
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 main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, A, B, C, D;
    cin >> N;
  for(int i;i<=N;A*=2){
A=i;     	
}
 
  cout << A;
  }
}

Compiler output:
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  if(n<2)cout<<n<<endl;
  else if(n<4)cout<<2<<endl;
  else if(n<8)cout<<4<<endl;
  else if(n<16)cout<<8<<endl;
  else if(n<32)cout<<16<<endl;
  else if(n<64)cout<<32<<<endl;
  else cout<<64<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: expected primary-expression before '<' token
   11 |   else if(n<64)cout<<32<<<endl;
      |                          ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
using namespace std;

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


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

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

int main() {
  int n,i,two;
  
  cin >> n;
  
  two = 1;
  
  while (true) {
    if (n > two) {
      two = two * 2;
    }
    else if (n == two) {
      cout << two << endl;
      break;
    }
    else if (n < two) {
      two = two/2;
      cour << two << endl;
      break;
    }
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:7: error: 'cour' was not declared in this scope
   21 |       cour << two << endl;
      |       ^~~~
Language: C++

u si n g namespace s t d ;
i n t main ( ) {
i n t n ;
ci n >> n ;
f o r ( i n t i = 0 ; i < 2 0; i++) {
i f ( n < (1<<( i +1))) {
c ou t << (1<< i ) << e n dl ;
break ;
}
}
r e t u r n 0 ;
}

Compiler output:
a.cc:1:1: error: 'u' does not name a type
    1 | u si n g namespace s t d ;
      | ^
a.cc:2:1: error: 'i' does not name a type
    2 | i n t main ( ) {
      | ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  cout << min({n - max(1,2,4,8,16,32,64)} << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: no matching function for call to 'max(int, int, int, int, int, int, int)'
    7 |   cout << min({n - max(1,2,4,8,16,32,64)} << endl;
      |                    ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 7 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 7 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 7 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 7 provided
a.cc:7:42: error: expected ')' before '<<' token
    7 |   cout << min({n - max(1,2,4,8,16,32,64)} << endl;
      |              ~                           ^~~
      |                                          )
Language: Java

import java.util.Scanner;

public class ABC068_B {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int i = 0;
		for(i = 1; i <= n; i = i * 2) {
		}
		i = i / 2;
		System.out.println(i);
	}
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  
  if(N!=1){
  
  for(int i=0;i<N;i++){
    if(pow(2,i)>N){
cout<<pow(2,i-1)<<endl;
    }
  }
    
    else{
cout<<1<<endl;
    }
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: expected '}' before 'else'
   15 |     else{
      |     ^~~~
a.cc:7:11: note: to match this '{'
    7 |   if(N!=1){
      |           ^
Language: C++

#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
 
template <class T> using V = vector<T>;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;
  	ci(n);
  FOR(i,0,10){
    if(pow(2,i)>n) {
      co(pow(2,i-1)
         break;
         }
                      }
         }

Compiler output:
a.cc:84:11: error: unterminated argument list invoking macro "co"
   84 |          }
      |           ^
a.cc: In function 'int main()':
a.cc:80:7: error: 'co' was not declared in this scope
   80 |       co(pow(2,i-1)
      |       ^~
a.cc:80:9: error: expected '}' at end of input
   80 |       co(pow(2,i-1)
      |         ^
a.cc:79:20: note: to match this '{'
   79 |     if(pow(2,i)>n) {
      |                    ^
a.cc:80:9: error: expected '}' at end of input
   80 |       co(pow(2,i-1)
      |         ^
a.cc:78:14: note: to match this '{'
   78 |   FOR(i,0,10){
      |              ^
a.cc:80:9: error: expected '}' at end of input
   80 |       co(pow(2,i-1)
      |         ^
a.cc:75:15: note: to match this '{'
   75 | signed main() {
      |               ^
Language: C++

#include<iostream>
using namespace std;

int main() {
  int N; cin >> N;
  int maxCount = 0, int res = 1;
  for (int i = 1; i <= N; i++) {
    int count = 0;
    int j = i;
    while (j % 2 == 0) {
      j /= 2;
      count += 1;
    }
    if (maxCount > count) {
      maxCount = count;
      res = i;
    }
  }
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: expected unqualified-id before 'int'
    6 |   int maxCount = 0, int res = 1;
      |                     ^~~
a.cc:16:7: error: 'res' was not declared in this scope
   16 |       res = i;
      |       ^~~
a.cc:19:11: error: 'res' was not declared in this scope
   19 |   cout << res << endl;
      |           ^~~
Language: C++

#include<iostream>
using namespace std;

int main() {
  int N; cin >> N;
  int maxCount = 0, int res = 1;
  for (int i = 1; i <= N; i++) {
    int count = 0;
    int j = i;
    while (j % 2 == 0) {
      j /= 0;
      count += 1;
    }
    if (maxCount > count) {
      maxCount = count;
      res = i;
    }
  }
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: expected unqualified-id before 'int'
    6 |   int maxCount = 0, int res = 1;
      |                     ^~~
a.cc:11:9: warning: division by zero [-Wdiv-by-zero]
   11 |       j /= 0;
      |       ~~^~~~
a.cc:16:7: error: 'res' was not declared in this scope
   16 |       res = i;
      |       ^~~
a.cc:19:11: error: 'res' was not declared in this scope
   19 |   cout << res << endl;
      |           ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  
  int answer = 0;
  
  for (int i = 0; i < N; i++) {
    if (N >= pow(i, 2)) {
      answer = i;
    }
    else break;
  }
  
  cout << pow(answer, 2) << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: 'pow' was not declared in this scope
   11 |     if (N >= pow(i, 2)) {
      |              ^~~
a.cc:17:11: error: 'pow' was not declared in this scope
   17 |   cout << pow(answer, 2) << endl;
      |           ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  
  int answer = 0;
  
  for (int i = 0; i < N; i++) {
    if (N >= 2**i) {
      answer = i;
    }
    else break;
  }
  
  cout << 2**answer << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: invalid type argument of unary '*' (have 'int')
   11 |     if (N >= 2**i) {
      |                ^~
a.cc:17:13: error: invalid type argument of unary '*' (have 'int')
   17 |   cout << 2**answer << endl;
      |             ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  
  int answer = 0;
  
  while (true) {
    for (int i = 0; i < N; ++i) {
      if (N >= 2**i) {
        answer = i;
      }
      else break;
    }
  }
  
  cout << 2**answer << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: invalid type argument of unary '*' (have 'int')
   12 |       if (N >= 2**i) {
      |                  ^~
a.cc:19:13: error: invalid type argument of unary '*' (have 'int')
   19 |   cout << 2**answer << endl;
      |             ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main () {
  int N;
  cin>>N;
  int a =-1;
  for (int i=1;i<N+1;i*=2) {
    a = i
  }
  
  cout << a<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: expected ';' before '}' token
    9 |     a = i
      |          ^
      |          ;
   10 |   }
      |   ~
Language: C++

#include<cstdio>
#include<iostream>

using namespace std;

int main(void)
{
	int N;
	int log = 0;
	cin >> N;

	log = log2(N);

	cout << pow(2, log);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'log2' was not declared in this scope; did you mean 'log'?
   12 |         log = log2(N);
      |               ^~~~
      |               log
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         cout << pow(2, log);
      |                 ^~~
Language: C++

#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(void)
{
	int N;

	cin >> N;

	int log = log2(N);

	cout << pow(2, log);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: 'log2' was not declared in this scope; did you mean 'log'?
   14 |         int log = log2(N);
      |                   ^~~~
      |                   log
a.cc:16:17: error: 'pow' was not declared in this scope
   16 |         cout << pow(2, log);
      |                 ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N = 0;
  cin>>N;
  
  if (N == 1){
     cout<<1<<endl;
  }
  else if (2<=N && N<=3){
    cout<<2<<endl;
  }
  else if (4<=N && N<=7){
    cout<<4<<endl;
  }
  else if (8<=N && N<=15){
    cout<<8<<endl;
  }
  else if (16<=N && N<=31){
    cout<<16<<endl;
  }
  else if (32<=N && N<=63){
    cout<<32<<endl;
  }
  else{
    cout<<64<<endl;
  }

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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N = 0;
  cin>>N;
  
  if (N == 1){
     cout<<1<<endl;
  }
  else if (2<=N && N<=3){
    cout<<2<<endl;
  }
  else if (4<=N && N<=7){
    cout<<4<<endl;
  }
  else if (8<=N && N<=15){
    cout<<8<<endl;
  }
  else if (16<=N && N<=31){
    cout<<16><<endl;
  }
  else if (32<=N && N<=63){
    cout<<32<<endl;
  }
  else{
    cout<<64<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: expected primary-expression before '<<' token
   21 |     cout<<16><<endl;
      |              ^~
Language: C++

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

int main(){
  int N = 0;
  cin>>N;
  
  if (N == 1){
    return 1;
  }
  else if (2<=N && N<=3){
    return 2;
  }
  else if (4<=N && N<=7){
    return 4;
  }
  else if (8<=N && N<=15){
    return 8;
  }
  else if (16<=N && N<=31){
    return 16;
  }
  else if (32<=N && N<=63){
    return 32;
  }
  else{
    return 64:
  }
}

    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: expected ';' before ':' token
   27 |     return 64:
      |              ^
      |              ;
a.cc:27:14: error: expected primary-expression before ':' token
Language: C++

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

int main(){
  int N = 0;
  cin>>N;
  
  if (N == 1){
    return 1;
  }
  else if (2<=N<=3){
    return 2;
  }
  else if (4<=N<=7){
    return 4;
  }
  else if (8<=N<=15){
    return 8;
  }
  else if (16<=N<=31){
    return 16;
  }
  else if (32<=N<=63){
    return 32;
  }
  else{
    return 64:
  }
}

    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: expected ';' before ':' token
   27 |     return 64:
      |              ^
      |              ;
a.cc:27:14: error: expected primary-expression before ':' token
Language: C++

#include <iostream>
using namespace std;

int main() {
	int N;
	cin >> N >> ;
	if (N >= 64 && 100 >= N)
	{
		cout << 64 << endl;
	}
	if (N >= 32 && 63 >= N)
	{
		cout << 32 << endl;
	}
	if (N >= 16 && 31 >= N)
	{
		cout << 16 << endl;
	}
	if (N >= 8 && 15 >= N)
	{
		cout << 8 << endl;
	}
	if (N >= 4 && 7 >= N)
	{
		cout << 4 << endl;
	}
	if (N >= 2 && 3 >= N)
	{
		cout << 2 << endl;
	}
	if (N == 1)
	{
		cout << 1 << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: expected primary-expression before ';' token
    6 |         cin >> N >> ;
      |                     ^
Language: C

#include <stdio.h>

int main()
{
	int n, i, x, qTmp, tmp, qSum = 0;;
	scanf("%d", &n);

	for (i = 1; i <= n; i++)
	{
		tmp = 0;
		x = i;
		while (true)
		{
			if (x % 2 == 0)
			{
				tmp++;
			}
			x /= 2;
			if (x <= 1)
				break;
		}
		if (tmp > qSum) {
			qSum = tmp;
			qTmp = i;
		}
	}

	printf("%d", qTmp);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:24: error: 'true' undeclared (first use in this function)
   12 |                 while (true)
      |                        ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:12:24: note: each undeclared identifier is reported only once for each function it appears in
   12 |                 while (true)
      |                        ^~~~
Language: C

#include<stdio.h>
int main(void)
{
  int N,num=1;
  int i;
  
  scanf("%d",&N);
  
  for(i=0;i<7;i++){
    num=num*2;
    if(num>N){
      printf("%d",num/2);
    }
    if(num==N){
      printf("%d",num);
    }
    return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:18:3: error: expected declaration or statement at end of input
   18 |   }
      |   ^
Language: C++

#include<stdio.h>
int main(void){
  int n;
  int num=1;
  int i=1;
  scanf("%d",&n);
  
  while(i=<n){
    i=i*2;
    num=i;
  }
  
  if(i>=num){
    printf("%d",num/2);
  }
  
  return 0;
}

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

#include<stdio.h>
int main(void)
{
 int i,n,max=0,maxn,s=0,a;
 scanf("%d",&n);

for(i=1;i<=n;i++)
{
  a=i;
  while(a%2==0)
  {
    s++;
    a=a/2;
  }
  if(s>max){max=s;maxn=i;}
  s=0;
}

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

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


int main(){
    int n;
    cin>>n;
    int max = 0;
    int tmp = 0;
    int tmp2 = 0;
    for(i=1; i<=n; i++){
        tmp2 = i;
        tmp = 0;
        while(1){
            if(tmp2%2==0){
                tmp2 = tmp2/2;
                tmp++;
            }
            else{
                if(max<tmp){
                    max = tmp;
                }
                break;
            }
        }
    }
    return 0;
}

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

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


int main(){
    int n;
    cin>>n;
    int max = 0;
    int tmp = 0;
    int tmp2 = 0;
    for(i=1; i<=n; i++){
        tmp2 = i;
        whiel(1){
            if(tmp2%2==0){
                tmp2 = tmp2/2;
                tmp++;
            }
            else{
                if(max<tmp){
                    max = tmp;
                }
                break;
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'i' was not declared in this scope
   17 |     for(i=1; i<=n; i++){
      |         ^
a.cc:19:9: error: 'whiel' was not declared in this scope
   19 |         whiel(1){
      |         ^~~~~
Language: C++

#include <iostream>

using namespace std;

void main() {
	int n;
	cin >> n;
	int i = 1;
	int ans = 1;

	while (i <= 100) {
		i *= 2;
		if (i > n) {
			cout << ans << endl;
			return;
		}
		ans = i;
	}

	return;
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:15:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
   15 |                         return;
      |                         ^~~~~~
a.cc:20:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   20 |         return;
      |         ^~~~~~
Language: C++

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

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

#include <iostream>
using namespace std;

int main() {

	int n;
	cin >> n;

	int p = 0;
	for (int i = 0;i < n;i++) {
		if (std::pow(2, i) > n) {
			p = i - 1;
			break;
		}
	}

	cout << std::pow(2, p) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: 'pow' is not a member of 'std'
   11 |                 if (std::pow(2, i) > n) {
      |                          ^~~
a.cc:17:22: error: 'pow' is not a member of 'std'
   17 |         cout << std::pow(2, p) << endl;
      |                      ^~~
Language: C++


#include "pch.h"
#include <iostream>
#include <string>
using namespace std;

int main() {

	int n;
	cin >> n;

	int p = 0;
	for (int i = 0;i < n;i++) {
		if (pow(2, i) > n) {
			p = i - 1;
			break;
		}
	}

	cout << pow(2, p) << endl;
}


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

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

int main() {

	int n;
	cin >> n;

	int p = 0;
	for (int i = 0;i < n;i++) {
		if (pow(2, i) > n) {
			p = i - 1;
			break;
		}
	}

	cout << pow(2, p) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'pow' was not declared in this scope
   12 |                 if (pow(2, i) > n) {
      |                     ^~~
a.cc:18:17: error: 'pow' was not declared in this scope
   18 |         cout << pow(2, p) << 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();
        while(n>=answer){
            answer *= 2;
        }
        System.out.println(answer/2);
    }
}

Compiler output:
Main.java:6: error: cannot find symbol
        while(n>=answer){
                 ^
  symbol:   variable answer
  location: class Main
Main.java:7: error: cannot find symbol
            answer *= 2;
            ^
  symbol:   variable answer
  location: class Main
Main.java:9: error: cannot find symbol
        System.out.println(answer/2);
                           ^
  symbol:   variable answer
  location: class Main
3 errors
Language: C++

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

int main(){
  int N;
  cin >>N;
  vector<int> counter(N,0);
  for(int i=1;i<=N;i++){
    while(i>0){
      if(i%2>0)
        break;
      i/=2;
      conter.at(i)++;
    }
  }
  sort(counter.begin(),counter.end());
  cout <<counter.at(N-1) <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'conter' was not declared in this scope; did you mean 'counter'?
   13 |       conter.at(i)++;
      |       ^~~~~~
      |       counter
Language: C++

#include <iostream>
using namespace std;


int main(){
    //cout<<"hello"<<endl;
    int N;cin>>N;
    int ans=0;
    int nums[110];
    for(int i=0;i<N;i++){
        nums[i]=i+1;    //1以上N以下
    }


    int maxNumDividableByTwo=1;
    int maxNumDividableByTwo_times=0;
    for(int i=0;i<N;i++){
        int numDividableByTwo_times=0;
        int numsForWhile=nums[i];
        while(numsForWhile%2==0){//無限ループ注意
        //無限ループに陥っているプログラムを終了しないとコンパイルに通らない
            numsForWhile/=2;
            numDividableByTwo_times++;
        }
        if(numDividableByTwo_times>maxNumDividableByTwo_times){
            maxNumDividableByTwo=nums[i];
            maxNumDividableByTwo_times=numDividableByTwo_times;
        }
    }


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

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;

int inf = (1 << 30);
int mod = 1e9;
long long long_inf = (1 << 60);

int main(){

    int N;
    cin >> N;

    int ans = 0;
    for(int i = 1; pow(2, i) <= N; i++){
        ans = pow(2, i);
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc:11:25: warning: left shift count >= width of type [-Wshift-count-overflow]
   11 | long long long_inf = (1 << 60);
      |                       ~~^~~~~
a.cc: In function 'int main()':
a.cc:19:20: error: 'pow' was not declared in this scope
   19 |     for(int i = 1; pow(2, i) <= N; i++){
      |                    ^~~
Language: C++

#include<iostream>
using namespace std;

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

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

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: expected primary-expression before '<' token
   25 |   else if(N =< 100){
      |              ^
a.cc:27:4: error: expected '}' at end of input
   27 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<iostream>
using namespace std;

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

  int ans;

  for(int i; i<6; ++i){
    if(pow(2,i)<=N) ans = pow(2,i);
  }

  cout << ans << endl;

} 


Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'pow' was not declared in this scope
   11 |     if(pow(2,i)<=N) ans = pow(2,i);
      |        ^~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  for( int i = 0; i < N; i++ ) {
    if( 2 ^ i >= N ) {
      i--;
      i = 2 ^ i
      cout << i << endl;
      break;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected ';' before 'cout'
   10 |       i = 2 ^ i
      |                ^
      |                ;
   11 |       cout << i << endl;
      |       ~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  for( int i = 0; i < N; i++ ) {
    if( 2 ^ i >= N ) {
      i--;
      cout << 2 ^ i << endl;
      break;
    }
  }
}

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

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

int main() {
  int N;
  cin >> N;
  for( int i = 0; i < N; i++ ) {
    if( 2 ^ i >= N ) {
      i--;
      cout << 2^i << endl;
      break;
    }
  }
}

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

from sys import exit
# A,B,C = [int(n) for n in input().split()]
N = int(input())
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
maxd = 0
for i in range(1,N+1):
    tmp = i
    tmpa = 0
    while(tmp%2 == 0):
        tmp//=2
        tmpa +=1
    if(maxd < tmpa):
        ans = i
        maxd = tmpa
print(ans)


Compiler output:
a.cc:2:3: error: invalid preprocessing directive #A
    2 | # A,B,C = [int(n) for n in input().split()]
      |   ^
a.cc:4:3: error: invalid preprocessing directive #a
    4 | # a = [int(input()) for _ in range(N)]
      |   ^
a.cc:5:3: error: invalid preprocessing directive #S
    5 | # S = str(input())
      |   ^
a.cc:6:3: error: invalid preprocessing directive #L
    6 | # L = len(S)
      |   ^
a.cc:7:3: error: invalid preprocessing directive #T
    7 | # T = str(input())
      |   ^
a.cc:1:1: error: 'from' does not name a type
    1 | from sys import exit
      | ^~~~
Language: C++

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

#define rep(i, n) for(int i = 0;i < n;i++)
int N;
int x;
//---------------------------------------------------------------------------------------------------
void main() {
    cin >> N;
    int macnt = -1, ans = -1;
    rep(x, 1, N + 1) {
        int cnt = 0;
        int y = x;
        while (y % 2 == 0) y /= 2, cnt++;
        if (macnt < cnt) macnt = cnt, ans = x;
    }
 
    cout << ans << endl;
}

Compiler output:
a.cc:11:20: error: macro "rep" passed 3 arguments, but takes just 2
   11 |     rep(x, 1, N + 1) {
      |                    ^
a.cc:4:9: note: macro "rep" defined here
    4 | #define rep(i, n) for(int i = 0;i < n;i++)
      |         ^~~
a.cc:8:1: error: '::main' must return 'int'
    8 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'rep' was not declared in this scope
   11 |     rep(x, 1, N + 1) {
      |     ^~~
Language: C++

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

int N;
//---------------------------------------------------------------------------------------------------
void main() {
    cin >> N;
    int macnt = -1, ans = -1;
    rep(x, 1, N + 1) {
        int cnt = 0;
        int y = x;
        while (y % 2 == 0) y /= 2, cnt++;
        if (macnt < cnt) macnt = cnt, ans = x;
    }
 
    cout << ans << endl;
}

Compiler output:
a.cc:6:1: error: '::main' must return 'int'
    6 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'x' was not declared in this scope
    9 |     rep(x, 1, N + 1) {
      |         ^
a.cc:9:5: error: 'rep' was not declared in this scope
    9 |     rep(x, 1, N + 1) {
      |     ^~~
Language: C++

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

int N;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    int macnt = -1, ans = -1;
    rep(x, 1, N + 1) {
        int cnt = 0;
        int y = x;
        while (y % 2 == 0) y /= 2, cnt++;
        if (macnt < cnt) macnt = cnt, ans = x;
    }
 
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'void _main()':
a.cc:9:9: error: 'x' was not declared in this scope
    9 |     rep(x, 1, N + 1) {
      |         ^
a.cc:9:5: error: 'rep' was not declared in this scope
    9 |     rep(x, 1, N + 1) {
      |     ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int maxn=0x7fffff;
int main(){
	int n,ma=-1,num;
	cin>>n;
	for(int i=1;i<=n;i++){
		int x=0;
		int nn=i;
		while(nn%2==0){
			nn/=2;
			x++;.
		}
		if(x>ma){
			ma=x;
			num=i;
		}
	}
	cout<<num;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: expected primary-expression before '.' token
   15 |                         x++;.
      |                             ^
a.cc:16:17: error: expected unqualified-id before '}' token
   16 |                 }
      |                 ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int i,n; 
  cin>>n;
 while(i<n){
   i*=2;
   }
   if(i<=n){
   cout<<i<<endl;
   }
   else if(i>n){
   cout<<i/2<<endl;
   }
  return 0;
}#include<iostream>
using namespace std;
int main(){
  int i,n; 
  cin>>n;
 while(i<n){
   i*=2;
   }
   if(i<=n){
   cout<<i<<endl;
   }
   else if(i>n){
   cout<<i/2<<endl;
   }
  return 0;
}

Compiler output:
a.cc:16:2: error: stray '#' in program
   16 | }#include<iostream>
      |  ^
a.cc:16:3: error: 'include' does not name a type
   16 | }#include<iostream>
      |   ^~~~~~~
a.cc:18:5: error: redefinition of 'int main()'
   18 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
Language: C++

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

int main() {
	int N;
	cin >> N;
	int res = 0;
	while (true) {
		N /= 2;
		if (N % 2 !=0) break;
		++res;
	}
	cout << pow(2,(double)res) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         cout << pow(2,(double)res) << endl;
      |                 ^~~
Language: C++

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

int main() {
	int N;
	cin >> N;
	int res = 0;
	while (true) {
		N /= 2;
		if (N % 2 !=0) break;
		++res;
	}
	cout << pow(2,res) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         cout << pow(2,res) << endl;
      |                 ^~~
Language: C++

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

double main() {
	int N;
	cin >> N;
	int res = 0;
	while (true) {
		N /= 2;
		if (N % 2 !=0) break;
		++res;
	}
	cout << pow(2,res) << endl;
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | double main() {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         cout << pow(2,res) << endl;
      |                 ^~~
Language: C++

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

int main() {
	int N;
	cin >> N;
	int res = 0;
	while (true) {
		N /= 2;
		if (N % 2 !=0) break;
		++res;
	}
	cout << pow(2.0,res) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         cout << pow(2.0,res) << endl;
      |                 ^~~
Language: C++

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

int main() {
	int N;
	cin >> N;
	int res = 0;
	while (true) {
		N /= 2;
		if (N % 2 == 1) break;
		++res;
	}
	cout << pow(2,res) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         cout << pow(2,res) << endl;
      |                 ^~~
Language: C++

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

int main() {
	int N;
	cin >> N;
	int res = 0;
	while (true) {
		n /= 2;
		if (n % 2 == 1) break;
		++res;
	}
	cout << pow(2,res) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'n' was not declared in this scope
   10 |                 n /= 2;
      |                 ^
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         cout << pow(2,res) << endl;
      |                 ^~~
Language: C++

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

int main() {
	int N;
	cin >> N;
	res = 0;
	while (true) {
		n /= 2;
		if (n % 2 == 1) break;
		++res;
	}
	cout << pow(2,res) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'res' was not declared in this scope
    8 |         res = 0;
      |         ^~~
a.cc:10:17: error: 'n' was not declared in this scope
   10 |                 n /= 2;
      |                 ^
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         cout << pow(2,res) << endl;
      |                 ^~~
Language: C++

#include<iostream>

using namespace std;

int main(void){
  int N;
  cin >> N;
  int ans = 1;
  while(N >= ans) ans <<= 1
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: expected ';' before 'cout'
    9 |   while(N >= ans) ans <<= 1
      |                            ^
      |                            ;
   10 |   cout << ans << endl;
      |   ~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:23:14: error: expected '}' at end of input
   23 |     return 0;
      |              ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  	int N;
  	cin >> N;
  	int max;
  	for (int i = 0; i < 7; i++) {
      	int two_pow_i = int(pow(2, i));
      	if (two_pow_i > N) {
        	max = int(pow(2, i-1));
          	break;
        }
    }
  	cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: 'pow' was not declared in this scope
    9 |         int two_pow_i = int(pow(2, i));
      |                             ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  // ここにプログラムを追記
  int N;
  cin >> N;
  int c = 0;
  int m = 0;
  vector<int> vec(110);
  
  for(int i = 0; i<N; i++){
    vec.at(i) = i;
  }
  while(true){
    bool check = false;
    for(int i = 0; i<N; i++){
      if(vec.at(i)%2 != 0)check = true;
      if(check)break;
      for(int i = 0; i<N; i++){
        vec.at(i) /= 2;
      }
      c++;
      if(c>m)m=c;
    }
    
      
}

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

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

int main(){
   int n;
   cin >> n;
   if (n>=64) cout << 6 << endl;
   else if (n>=32) cout << 5 << endl;
   else if (n>=16) cout << 4 << endl;
   else if (n>=8) cout << 3 << endl;
   else if (n>=4) cout << 2 << endl;
   else if (n>=2) cout << 1 << endl;
   else if cout << 0 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected '(' before 'cout'
   13 |    else if cout << 0 << endl;
      |            ^~~~
      |            (
Language: C

#include <stdio.h>
int main(){
  int n,max = 0;
  scanf("%d",&n);
  for(int i = 1;i <= n;i++){
    int cnt = 0;
    int j = i;
    whole(j % 2 < 1){
      cnt++;
      j /= 2;
    }
    if(max < cnt){
      max = cnt;
    }
  }
  printf("%d\n",cnt);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'whole' [-Wimplicit-function-declaration]
    8 |     whole(j % 2 < 1){
      |     ^~~~~
main.c:8:21: error: expected ';' before '{' token
    8 |     whole(j % 2 < 1){
      |                     ^
      |                     ;
main.c:16:17: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
   16 |   printf("%d\n",cnt);
      |                 ^~~
      |                 int
main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main(){
	int N;
  cin >>N;
  int res=0;
  int ans=0;
  for (int i=1;i<=N;i++){
    int cnt=0;
    int j=i;
    
    while(true){
      if(j%2==0){
        j/=2;
        cnt++;
      }else{
        break;
      }
    }  
    if(res<cnt){
      res=cnt;
      ans=i;
    }
    cout <<ans <<endl;
}

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

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

int main(){
	int N;
  cin >>N;
  int res=0;
  for (int i=1;i<=N;i++){
    int cnt=0;
    int j=i;
    
    while(true){
      if(j%2==0){
        j/=2;
        cnt++;
      }else{
        break;
      }
    if(res<cnt)res=cnt;
    }
    cout <<res <<endl;
}

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