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

#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
const int MOD = 1000000007;
using namespace std;

int main(){
    int N,maxnum=1,maxcount=0;

	cin >> N;
    for(int i=1;i<=N;i++){
        int num = i;
        int count = 0;
        while(true){
            // printf("%d ",num);
            if(num%2!=0 || num == 0){
                break;
            }else{
                num /= 2;
                count++;
            }
        }
        // printf("\n");
        if(count>maxcount){
            maxcount=count;
            maxnum = i;
        }
    }
    cout << maxnum << endl;
}

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

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
#define rep(i,n) for (ll i = 0; i < (ll)(n); ++i)
#define rrep(i,j,n) for(ll i = (ll)(j); i < (ll)(n); i++)
#define mrep(i,n) for (ll i = (ll)(n); i > 0; i--)
#define be(v) (v).begin(), (v).end()
#define dcout cout << fixed << setprecision(20) 
ll INF = 1LL << 60;
ll mod = 1e9 + 7;

int main() {
	int n;
	cin >> n;
	int ans=0;
	for(int i=n;i>=0;i--) {
		int count = 0;
		for(int j=0;j<n;j++) {
			if(i%2==0) count++;
			else goto H;
		}
		H:
		ans=max(ans,count);
	}
	pcout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'pcout' was not declared in this scope; did you mean 'dcout'?
   27 |         pcout << ans << endl;
      |         ^~~~~
      |         dcout
Language: C

#include <stdio.h>
int main(void) {
	int n;
	scanf("%d",&n);
	int ans=0;
	for(int i=n;i>=0;i--) {
		int count = 0;
		for(int j=0;j<n;j++) {
			if(i%2==0) count++;
			else goto H;
		}
		H:
		ans=max(ans,count);
	}
	printf("%d\n",ans);
}

Compiler output:
main.c: In function 'main':
main.c:13:21: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
   13 |                 ans=max(ans,count);
      |                     ^~~
Language: C++


using namespace std;

int main(){

  //initialization
  int N;
  int ans=0;
   
  //input
  cin >> N;
  int even[N+1];
  for(int i=0; i<=N; i++) even[i] = 0;

  //solver

  for(int i=N/2; i<=N; i++){
    int j = i;  
    while(  (j%2) != 1){
      even[i] += 1;
      j /= 2;
    }
    
    if(ans < even[i]) ans=even[i];
   //output
   //cout << i << " " << even[i] << "\n";
  }
  cout << ans << "\n"; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   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 | 
a.cc:28:3: error: 'cout' was not declared in this scope
   28 |   cout << ans << "\n";
      |   ^~~~
a.cc:28:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

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

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

#include <stdio.h>
void main(){
  int input,i,max=-1;
  scanf("%d",&input);
  for(i=0;i<input;i++){
    if(max<(i%2)){
      max=i%2;
    }
  }
  printf("%d",max);
}

Compiler output:
a.cc:2:1: error: '::main' must return 'int'
    2 | void main(){
      | ^~~~
Language: C++

void main(){
  int input,i,max=-1;
  scanf("%d",&input);
  for(i=0;i<input;i++){
    if(max<(i%2)){
      max=i%2;
    }
  }
  printf("%d",max);
}

Compiler output:
a.cc:1:1: error: '::main' must return 'int'
    1 | void main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:3: error: 'scanf' was not declared in this scope
    3 |   scanf("%d",&input);
      |   ^~~~~
a.cc:9:3: error: 'printf' was not declared in this scope
    9 |   printf("%d",max);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | void main(){
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a;
  cin >> a;
  for(int i=0;i<20;i++){
    if(n<(1<<(i+1))){
      cout << (i<<n) << endl;
      break;
    }
  }
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++)
    a[i]=i;
  int count=0;
  int max=0;
  int max_number;
  for(int i=0;i<n;i++){
    while(true){  
        if(a[i]%2==0){
          count++;
          a[i]/=2;
        }
        if(a[i]%2!=0)break;
    }
    int max=max(max,count);
    if(max==count)
      max_number=i;
  } 
  cout << max_number << endl;
}

  
    
      
      
     


Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: 'max' cannot be used as a function
   20 |     int max=max(max,count);
      |             ~~~^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++)
    a[i]=i;
  int count=0;
  int max=0;
  int max_number;
  for(int i=0;i<n;i++){
    while(true){  
        if(a[i]%2==0){
          count++;
          a[i]/=2;
        }
        if(a[i]%2!=0)break;
    }
    max=max(max,count);
    if(max==count)
      max_number=i;
  } 
  cout << max_number << endl;
}

  
    
      
      
     

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'max' cannot be used as a function
   20 |     max=max(max,count);
      |         ~~~^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    ll N,;
    cin >> N;
    
    ll ans=0;
    for(int i=N;i>=1;i--){
        if(i%2==0){cout<<i<<endl;return 0;}
    }
    cout<<1<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected unqualified-id before ';' token
    7 |     ll N,;
      |          ^
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,a,n) for(ll i = a;i < n;i++)
#define rrep(i,a,n) for(ll i = n; i >= a;i--)
#define index_check(i,n) if(i > n-1 || i < 0) continue; 
#define LINF 1e18
#define INF 1e9
#define MOD (ll)(1e9+7)
using namespace std;

#define fs first
#define sc second

using P = pair<ll,ll>;
using Pll = pair<P,ll>;
using PQ = priority_queue<P,vector<P>,greater<P>>;

signed main(){
    ll n;
    cin >> n;
    ll cnt = 0,ans = ,memo,a;
    rep(i,1,n+1){
        a = i;
        cnt = 0;
        while(a % 2 == 0){
            cnt++;
            a /= 2;
        }
        if(ans != (ll)max(ans,cnt)){
            ans = max(ans,cnt);
            memo = i;
        }
        
    }

    cout << memo << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: expected primary-expression before ',' token
   21 |     ll cnt = 0,ans = ,memo,a;
      |                      ^
a.cc:23:9: error: 'a' was not declared in this scope
   23 |         a = i;
      |         ^
a.cc:31:13: error: 'memo' was not declared in this scope
   31 |             memo = i;
      |             ^~~~
a.cc:36:13: error: 'memo' was not declared in this scope
   36 |     cout << memo << endl;
      |             ^~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector <int> A={1, 2, 4, 8, 16, 32, 64};
  for (int i=0; i<6; i++){
    if (N<A[i]){
      a=A[i-1];
      break;
    }
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'a' was not declared in this scope
   10 |       a=A[i-1];
      |       ^
a.cc:14:11: error: 'a' was not declared in this scope
   14 |   cout << a << endl;
      |           ^
Language: C++

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

int main(){
  int N, a;
  cin >> N;
  while(1){
    bool small=true;
    for (int i=1; i<N; i*=2){
      if (i>N){
        small false;
        i=a;
      }
    }
    if (small){
      break;
    }
  }
  a/=2;
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: expected ';' before 'false'
   11 |         small false;
      |              ^~~~~~
      |              ;
Language: C++

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

int main(){
  int N, a;
  cin >> N;
  while(1){
    bool small true;
    for (int i=1; i<N; i*=2){
      if (i>N){
        small false;
        i=a
      }
    }
    if (small){
      break;
    }
  }
  a/=2;
  cout << i << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected initializer before 'true'
    8 |     bool small true;
      |                ^~~~
a.cc:11:9: error: 'small' was not declared in this scope; did you mean 'scalbl'?
   11 |         small false;
      |         ^~~~~
      |         scalbl
a.cc:12:12: error: expected ';' before '}' token
   12 |         i=a
      |            ^
      |            ;
   13 |       }
      |       ~     
a.cc:15:9: error: 'small' was not declared in this scope; did you mean 'scalbl'?
   15 |     if (small){
      |         ^~~~~
      |         scalbl
a.cc:20:11: error: 'i' was not declared in this scope
   20 |   cout << i << endl;
      |           ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  bool small true;
  while(1){
    for (int i=1; i<N; i++){
      if (i>N){
        small false;
      }
    }
    if (small){
      break;
    }
    i*=2;
  }
  i/=2;
  cout << i << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected initializer before 'true'
    7 |   bool small true;
      |              ^~~~
a.cc:11:9: error: 'small' was not declared in this scope; did you mean 'scalbl'?
   11 |         small false;
      |         ^~~~~
      |         scalbl
a.cc:14:9: error: 'small' was not declared in this scope; did you mean 'scalbl'?
   14 |     if (small){
      |         ^~~~~
      |         scalbl
a.cc:17:5: error: 'i' was not declared in this scope
   17 |     i*=2;
      |     ^
a.cc:19:3: error: 'i' was not declared in this scope
   19 |   i/=2;
      |   ^
Language: C++

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

int main(){

  int n;
  cin >> n;

  int counter = 0;
  while(true){
    int num = pow(2,counter);

    if(num == n) {
      cout << num; 
      break;
    }
    else if (num > n) {
      cout << num/2; 
      break;
    }
    else {
      ++counter;
    }
  
 }

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

#include <iostream>

using namespace std;

int main(){

  int n;
  cin >> n;

  int counter = 0;

  while(true){
    
    if(2^counter >= n) {
      cout << 2^counter;
      break;
    }
    ++counter;
  }
  
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>' and 'int')
   15 |       cout << 2^counter;
      |       ~~~~~~~~~^~~~~~~~
      |            |    |
      |            |    int
      |            std::basic_ostream<char>
a.cc:15:16: note: candidate: 'operator^(int, int)' (built-in)
   15 |       cout << 2^counter;
      |       ~~~~~~~~~^~~~~~~~
a.cc:15:16: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/cstddef:146:3: note: candidate: 'constexpr std::byte std::operator^(byte, byte)'
  146 |   operator^(byte __l, byte __r) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/cstddef:146:18: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::byte'
  146 |   operator^(byte __l, byte __r) noexcept
      |             ~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:94:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator^(_Ios_Fmtflags, _Ios_Fmtflags)'
   94 |   operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:94:27: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Fmtflags'
   94 |   operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:144:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator^(_Ios_Openmode, _Ios_Openmode)'
  144 |   operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:144:27: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Openmode'
  144 |   operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:191:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator^(_Ios_Iostate, _Ios_Iostate)'
  191 |   operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:191:26: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Iostate'
  191 |   operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before '}' token
    9 |     cout<<1
      |            ^
      |            ;
   10 |   }else if(N<=3){
      |   ~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before '}' token
    9 |     cout<<1
      |            ^
      |            ;
   10 |   }elseif(N<=3){
      |   ~         
a.cc:10:4: error: 'elseif' was not declared in this scope
   10 |   }elseif(N<=3){
      |    ^~~~~~
a.cc:20:4: error: 'else' without a previous 'if'
   20 |   }else{
      |    ^~~~
Language: C++

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

int main(){
  int N;
  int max = 0;
  int cmax=0;
  int i;
  
  cin >> N;
  for (i=1;i<=N;i++){
    int counter = 0;
    while(i%2 =0){
      counter = counter+1;
      i = i/2;
    }
    if(counter >= cmax){
      max = i;
      cmax = counter;
    }
  }
  cout << max;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: lvalue required as left operand of assignment
   13 |     while(i%2 =0){
      |           ~^~
Language: C++

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

int main(){
  int N;
  int max = 0;
  int cmax=0;
  int i;
  
  cin >> N;
  for (i=1,i<=N,i++){
    int counter = 0;
    while(i%2 =0){
      counter = counter+1;
      i = i/2;
    }
    if(counter >= cmax){
      max = i;
      cmax = counter;
    }
  }
  cout << max;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: expected ';' before ')' token
   11 |   for (i=1,i<=N,i++){
      |                    ^
      |                    ;
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
a.cc:22:15: error: expected ')' before '}' token
   22 |   cout << max;
      |               ^
      |               )
   23 | 
   24 | }
      | ~              
a.cc:11:7: note: to match this '('
   11 |   for (i=1,i<=N,i++){
      |       ^
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
Language: C++

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

int main(){
  int N;
  int max = 0;
  int cmax=0;
  
  cin >> N;
  for (i=1,i<=N,i++){
    int counter = 0;
    while(i%2 =0){
      counter = counter+1;
      i = i/2;
    }
    if(counter >= cmax){
      max = i;
      cmax = counter;
    }
  }
  cout << max;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'i' was not declared in this scope
   10 |   for (i=1,i<=N,i++){
      |        ^
a.cc:23:3: error: expected primary-expression before 'return'
   23 |   return 0;
      |   ^~~~~~
a.cc:21:15: error: expected ')' before 'return'
   21 |   cout << max;
      |               ^
      |               )
   22 | 
   23 |   return 0;
      |   ~~~~~~       
a.cc:10:7: note: to match this '('
   10 |   for (i=1,i<=N,i++){
      |       ^
Language: C++

#include <iostream>
using namespace std;

int N;
int res;
int A[210];         // 最大 200 個なので余裕を持って 210 に --- 200 以上ならなんでもよいです

int main() {
    cin >> N;
    for (int i = 1; i <= N; ++i)  A[i]=i;

    // 操作が行える限り操作を繰り返す
    while (true) {
        bool exist_odd = false;  // A[i] がすべて偶数かどうかを判定するフラグ
        for (int i = 0; i < N; ++i) {
            if (A[i] % 2 != 0) exist_odd = true;  // 奇数があったらフラグを立てる
        }

        if (exist_odd) 
          res = i;
          break;  // 奇数があったら break

        // 操作を行えるなら操作を実際に行う
        for (int i = 0; i < N; ++i) {
            A[i] /= 2;
        }
    }

    cout << A[res] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'i' was not declared in this scope
   20 |           res = i;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include<set> 
#include<math.h>
#define pai 3.14159265358979323846264338327950288;
#define keta(n) cout << fixed << setprecision((n));
using ll = long long;
int main(){
  int n;
  cin>>n;
  int ans = 1;
  while(ans<=n){
    ans *= 2;
  }
  cout<<ans/2<<endl;


}
c

Compiler output:
a.cc:20:1: error: 'c' does not name a type
   20 | c
      | ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'res' was not declared in this scope
    8 |   while(ans <= n) res *= 2;
      |                   ^~~
Language: C++

#include<stdio.h>
#include<math.h>
int main()
{
  int n,c;
  while(~scanf("%d", &n))
  {
    c = (logn)/(log2);
    n = pow(2,c);
    printf("%d\n", n);
  }
  return 0;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'logn' was not declared in this scope; did you mean 'long'?
    8 |     c = (logn)/(log2);
      |          ^~~~
      |          long
Language: C++

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

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

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

// answer output
#define Yes(c) cout << ((c) ? "Yes" : "No") << endl;
#define YES(c) cout << ((c) ? "YES" : "NO") << endl;
#define yes(c) cout << ((c) ? "yes" : "no") << endl;
 
#define possible(c) cout << ((c) ? "possible" : "impossible") << endl;
#define POSSIBLE(c) cout << ((c) ? "POSSIBLE" : "INPOSSIBLE") << endl;

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:19: error: 'endkl' was not declared in this scope
   39 |     cout << 32 << endkl;
      |                   ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
 
//答えは必ず2の累乗
int main() {
    int N; 
	cin >>N;
  	int p = N;
    int answer = 0;
    
//for文書いてiカウントしてiの数だけ2をかけるとかやるのがかっこいいんだろうけど
//力技
    if(p==1){
    answer==1;
    }	//1は0回割れるから1が最大ってことね
  
  	else if(p>=2,p<=3){
    answer+=2;
    }
  
  	else if(p>=4,p<=7){
    answer+=4;
    }
  
  	else if(p>=8,p<=15){
    answer+=8;
    }  
  
  	else if(p>=16,p<=31){
    answer+=16;
    } 
  
  	else if(p>=32,p<=63){
    answer+=32;
    }   
  
  	else{
    answer+=64;
    }        
 
    cout << answer << endl;
    }
#include <bits/stdc++.h>
using namespace std;


//答えは必ず2の累乗
int main() {
    int N; 
	cin >>N;
  	int p = N;
    int answer = 0;
    
//for文書いてiカウントしてiの数だけ2をかけるとかやるのがかっこいいんだろうけど
//力技
    if(p==1){
    answer+=1;
    }	//1は0回割れるから1が最大ってことね
  
  	else if(p>=2,p<=3){
    answer+=2;
    }
  
  	else if(p>=4,p<=7){
    answer+=4;
    }
  
  	else if(p>=8,p<=15){
    answer+=8;
    }  
  
  	else if(p>=16,p<=31){
    answer+=16;
    } 
  
  	else if(p>=32,p<=63){
    answer+=32;
    }   
  
  	else{
    answer+=64;
    }        

    cout << answer << endl;
    }


Compiler output:
a.cc:49:5: error: redefinition of 'int main()'
   49 | int main() {
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main() {
      |     ^~~~
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    // 7
    int n = 8;
    int j = 2;
    int k = 0; // カウントする数
    while(((n/j)/2)%2==0){
      if(n%j == 0){
        j = j* 2;
        k = k+1;
      }else{
        break;
      }
    }
    System.out.println(j*2);
  }
}


Compiler output:
Main.java:7: error: variable n is already defined in method main(String[])
    int n = 8;
        ^
1 error
Language: Java

import java.util.*;
public class{
  public static void main(String[] args{
    Scanner sc = new Scaner(System.in);
    int n = sc.nextInt();
    int j = 2;
    int k = 0; // カウントする数
    while( 0 <= j && j <= n){
      if(n%j == 0){
        j = j* 2;
        k = k+1;
      }else{
        System.out.println(j);
      }      
    }
  }
}


Compiler output:
Main.java:2: error: <identifier> expected
public class{
            ^
Main.java:3: error: ',', ')', or '[' expected
  public static void main(String[] args{
                                       ^
2 errors
Language: C++

//AUTHOR:BlackBox Inc.//
#include<bits/stdc++.h>
#include<unordered_map>
#include<tr1/unordered_map>
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vlli vector<long long int>
#define vvi vector<vector<int>>
#define endl "\n"
#define vpii vector<pair<int,int>>
#define vs vector<string>
#define lin1(x) ll int x; x = scan();
#define lin2(x,y) ll int x, y; x = scan(), y = scan();
#define lin3(x,y,z) ll int x, y, z; x = scan(), y = scan(), z = scan();
#define pb(x) push_back(x)
#define makep(x,y) make_pair(x,y)
#define mx(a,b) (a)>(b)?(a):(b)
#define mn(a,b) (a)<(b)?(a):(b)
#define fori(s,e) for(i=s;i<=e;i++)
#define forj(s,e) for(j=s;j<=e;j++)
#define fork(s,e) for(k=s;k<=e;k++)
#define rep(i,s,e) for(int i=s;i<=e;i++)
#define brep(i,s,e) for(int i=s;i>=e;i--)
#define all(x) x.begin(),x.end()
#define mem(x,y) memset(x,y,sizeof(x));
#define bits1(x) __builtin_popcount(x)
#define pi 3.14159265358979323846264338327950
#define MOD7 1000000007
#define MOD9 1000000009
#define fast std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
using namespace std::tr1;

int main()
{
#ifdef RAHUL
    freopen("input.txt","r",stdin);
#endif

int rahul;
cin>>rahul;

cout<<pow(2, int(log(rahul)/log(2)))a<<endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:37: error: expected ';' before 'a'
   44 | cout<<pow(2, int(log(rahul)/log(2)))a<<endl;
      |                                     ^
      |                                     ;
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'k' was not declared in this scope
   10 |   while (k <= n) {
      |          ^
a.cc:13:11: error: 'k' was not declared in this scope
   13 |   cout << k/2 << endl;
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=61
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef pair<int,int> pairii;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int main() {
  cin>>n;
  if(n>=64){cout<<64<<endl;return 0;}
  else if(n>=32){cout<<32<<endl;return 0;}
  else if(n>=16){cout<<16<<endl;return 0;}
  else if(n>=8){cout<<8<<endl;return 0;}
  else if(n>=4){cout<<4<<endl;return 0;}
  else if(n>=2){cout<<2<<endl;return 0;}
         else cout<<1<<endl;        
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m1(x) memset(x,-1,sizeof(x))
const int INF = 1e9 + 1;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589793;

int main(){
  int n;
  cin >> n;
  rep(i, 8){
    int ans = pow(2, i);
    if(ans > n){
      ans = ans/2;
      break;
    }
  }
  cout << ans <<endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int a,n,ans;
int main()
{
	cin>>a;
	if(a==1)
	{
		cout<<1<<endl
		return 0;;
	}
	for(int i=1;i<=30;i++)
	{
		if(pow(2,i)<=a&&pow(2,i+1)>a)
		{
			cout<<pow(2,i)<<endl;
			return 0;
		}
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:30: error: expected ';' before 'return'
    9 |                 cout<<1<<endl
      |                              ^
      |                              ;
   10 |                 return 0;;
      |                 ~~~~~~
Language: Java

import java.util.Scanner;

public class InputSample {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
      	int n = 0;
        if ( 2 ^ n <= N ) {
          n = n + 1;
        } else {
          System.out.println(2^n);
        }   
    }
}

Compiler output:
Main.java:3: error: class InputSample is public, should be declared in a file named InputSample.java
public class InputSample {
       ^
Main.java:8: error: bad operand types for binary operator '^'
        if ( 2 ^ n <= N ) {
               ^
  first type:  int
  second type: boolean
2 errors
Language: C++

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

int main() {
  // ここにプログラムを追記
  int N;
  cin>>N;
  if(N ==1 )cout<<N<<endl;
  
  if(){
          for (int i=1;i<N;i++){
           double A,B;
            A =double pow(double 2, double i);
            B =double pow(double 2, double i+1);
            if(A=<N<B){
              cout<<i<<endl;
            break;
            }
          }
  }
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:6: error: expected primary-expression before ')' token
   12 |   if(){
      |      ^
a.cc:15:16: error: expected primary-expression before 'double'
   15 |             A =double pow(double 2, double i);
      |                ^~~~~~
a.cc:16:16: error: expected primary-expression before 'double'
   16 |             B =double pow(double 2, double i+1);
      |                ^~~~~~
a.cc:17:18: error: expected primary-expression before '<' token
   17 |             if(A=<N<B){
      |                  ^
Language: C++

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

int main() {
  // ここにプログラムを追記
  int N;
  cin>>N;
  if(N ==1 || N %2==0)cout<<N<<endl;
  
  
  for (int i=(N-1);i>1;i--){
    if(i%2==0){
      cout<<i<<endl;
    break;
    }
    
}

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

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define repp(i, n) for(int i = 1; i <= n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define pb push_back
#define riverse(v) reverse((v).begin(), (v).end())
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<ll>;
const int MOD = 1e9+7;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: expected ';' before numeric constant
   21 |         else if(N>=16) ans 16;
      |                           ^~~
      |                           ;
Language: C

#include<stdio.h>
int main(void){
  int n,cnt;
  scanf("%d",&n);
  for(int i=1;i<=n;i*=2){
    cnt=i;
  }
  printf("%d\n",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: 'ans' undeclared (first use in this function)
    8 |   printf("%d\n",ans);
      |                 ^~~
main.c:8:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main() {
  int N, n=0; x=2; cin >> N;
  while (true) {
    if (x<=N) {
      x *= 2;
      n++;
    } else break;
  }
  cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'x' was not declared in this scope
    5 |   int N, n=0; x=2; cin >> N;
      |               ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
#define rrep(i,n) for(int i=1; i<=(n); ++i)
#define drep(i,n) for(int i=(n)-1; i>=0; --i)
#define srep(i,s,t) for (int i=s; i<t; ++i)
#define pb push_back
using namespace std;
using P = pair<int,int>;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef tuple<int,int,int> T;
typedef vector<P> vp;
typedef vector<T> vt;

// head
int main (void){
  int N;
  for(int i=1; i<=N; i++){
    int ans;
    ans=N/2;
  }
  cout << max(0, ans) << endl;
  return 0;
}  

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

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

int main(){
	int N;
	cin >> N;
	
	int cnt=0;
	int pre=0;
	
	//入力が１の時は１が正解
	int ans=1;
	for(int i=1; i<=N; i++){
		int n=i;
		
		//割れる回数を計算
		int cnt=0;
		while(n%2==0){
			cnt++;
			n/=2;
		}
	
		//割れる回数がそれまでを上回ったら上書き
		if(cnt>pre){
			pre=cnt;
			ans=i;
	}
	cout << ans << endl;
}

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

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

int main(){
	int N;
	cin >> N;
	
	int cnt=0;
	int pre=0;
	int ans=1; //入力が１の時は１が正解
	for(int i=1; i<=N; i++){
		int n=i;
		
		//割れる回数を計算
		int cnt=0;
		while(n%2==0){
			cnt++;
			n/=2;
		}
	
		//割れる回数がそれまでを上回ったら上書き
		if(cnt>pre){
			pre=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:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin>>n;
  int a[10]={1,2,4,8,16,32,64,128,256,512};
  int f=0;
  for(int i=0;i<10;i++){
    if(a[i]<=n){
      f=a[i];
    }
  }
  cout<<a[i];
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'i' was not declared in this scope
   16 |   cout<<a[i];
      |           ^
Language: C++


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

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin>>n;
  int a[10]=[1,2,4,8,16,32,64,128,256,512];
  int f=0;
  for(int i=0;i<10;i++){
    if(a[i]<=n){
      f=a[i];
    }
  }
  cout<<a[i];
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected identifier before numeric constant
   10 |   int a[10]=[1,2,4,8,16,32,64,128,256,512];
      |              ^
a.cc:10:15: error: expected ']' before ',' token
   10 |   int a[10]=[1,2,4,8,16,32,64,128,256,512];
      |               ^
      |               ]
a.cc: In lambda function:
a.cc:10:15: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:10:13: error: array must be initialized with a brace-enclosed initializer
   10 |   int a[10]=[1,2,4,8,16,32,64,128,256,512];
      |             ^~
a.cc:10:16: error: expected unqualified-id before numeric constant
   10 |   int a[10]=[1,2,4,8,16,32,64,128,256,512];
      |                ^
a.cc:17:11: error: 'i' was not declared in this scope
   17 |   cout<<a[i];
      |           ^
Language: C++

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

int main() {
  int n,i;
  cin >>n;
  i=1;
  while(i<=n) i *= 2;
  cout <<i/2<<endl;
  }
}

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

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

int main() {
  int n,i;
  cin >>n;
  i=1;
  while(i<=n) i *= 2;
  cout <<i/2<<endl;
  }
}

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

int main(){
    int n;
    cin >> n;
    int mx = 0;
    int ans = 0;
    for(int i = 1; i <= n; i++){
        int cnt = 0;
        int tmp = i;
        while(tmp%2 == 0){
            tmp /= 2;
            cnt++;
        }
        if(mx <= cnt){
            mx = cnt;
            ans = i;
        }
    }    
    cout << ans << 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 << ans << endl;
      |     ^~~~
a.cc:18:20: error: 'endl' was not declared in this scope
   18 |     cout << ans << endl;
      |                    ^~~~
Language: C++

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


int main(){
int n;
cin >> n;
int count = 0;
int mx = 0;
int k, ans;

if (n == 1)
{
    ans = 1;
    goto goal:
}


for (int i = 0; i < n; i++)
{
    count = 0;
    k = i + 1;
    while (k % 2 == 0)
    {
        k /= 2;
        count++;
    }

    if (count > mx)
    {
        ans = i + 1;
        mx = count;
    }
    
    
    
}
goal:
cout << ans << endl;
}

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

#include<iostream>
using namespace std;
int N;
int main(){
  cos >> N;
  int count=0;
  int max = 1;
for(i=0;i<N;i++){
  if(max*2<=N){
  max *= 2;
    count++;
}
}
  cout << count << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cos' was not declared in this scope
    5 |   cos >> N;
      |   ^~~
a.cc:8:5: error: 'i' was not declared in this scope
    8 | for(i=0;i<N;i++){
      |     ^
Language: C++

#include<iostream>
using namespace std;
int N;
int main(){
  cos >> N;
  int max = 1;
while(max*2 <= N){
  max *= 2;
}
  cout << max << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cos' was not declared in this scope
    5 |   cos >> N;
      |   ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int max = 1;
while(max*2 <= N){
  max *= 2;
}
  cout << max << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: 'N' was not declared in this scope
    5 | while(max*2 <= N){
      |                ^
Language: C++

#include<iostream>
using namespace std;

int N;

int main(){
  cin >> N;
  int A[]=[1,2,4,8,16,32,64];
  
    for(int i=0;i<A.size();++i){
      if(N=A[0]){
        cout << A[0] << endl;
      }
      break;
      if(N<A[i]){
        cout << A[i-1] << endl;
      }
      break;
    }
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected identifier before numeric constant
    8 |   int A[]=[1,2,4,8,16,32,64];
      |            ^
a.cc:8:13: error: expected ']' before ',' token
    8 |   int A[]=[1,2,4,8,16,32,64];
      |             ^
      |             ]
a.cc: In lambda function:
a.cc:8:13: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:8:11: error: initializer fails to determine size of 'A'
    8 |   int A[]=[1,2,4,8,16,32,64];
      |           ^~
a.cc:8:11: error: array must be initialized with a brace-enclosed initializer
a.cc:8:14: error: expected unqualified-id before numeric constant
    8 |   int A[]=[1,2,4,8,16,32,64];
      |              ^
a.cc:10:21: error: request for member 'size' in 'A', which is of non-class type 'int [1]'
   10 |     for(int i=0;i<A.size();++i){
      |                     ^~~~
Language: C++

#include<iostream>
using namespace std;

int N;

int main(){
  cin >> N;
  int A=[1,2,4,8,16,32,64];
  
    for(int i=0;i<A.size();++i){
      if(N=A[0]){
        cout << A[0] << endl;
      }
      if(N<A[i]){
        cout << A[i-1] << endl;
      }
      
    }
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected identifier before numeric constant
    8 |   int A=[1,2,4,8,16,32,64];
      |          ^
a.cc:8:11: error: expected ']' before ',' token
    8 |   int A=[1,2,4,8,16,32,64];
      |           ^
      |           ]
a.cc: In lambda function:
a.cc:8:11: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:8:9: error: invalid user-defined conversion from 'main()::<lambda()>' to 'int' [-fpermissive]
    8 |   int A=[1,2,4,8,16,32,64];
      |         ^~
a.cc:8:9: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
    8 |   int A=[1,2,4,8,16,32,64];
      |         ^
a.cc:8:9: note:   no known conversion from 'void (*)()' to 'int'
a.cc:8:12: error: expected unqualified-id before numeric constant
    8 |   int A=[1,2,4,8,16,32,64];
      |            ^
a.cc:10:21: error: request for member 'size' in 'A', which is of non-class type 'int'
   10 |     for(int i=0;i<A.size();++i){
      |                     ^~~~
a.cc:11:13: error: invalid types 'int[int]' for array subscript
   11 |       if(N=A[0]){
      |             ^
a.cc:12:18: error: invalid types 'int[int]' for array subscript
   12 |         cout << A[0] << endl;
      |                  ^
a.cc:14:13: error: invalid types 'int[int]' for array subscript
   14 |       if(N<A[i]){
      |             ^
a.cc:15:18: error: invalid types 'int[int]' for array subscript
   15 |         cout << A[i-1] << endl;
      |                  ^
Language: C++

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

int main(){
  int S;
  cin>>S;
  for(int i=0;i<100;i++){
    if(S.at(i)/64==0){
      cout<<S.at(i)<<endl;
    }
    else if (S.at(i)/32==0){
      cout<<S.at(i)<<endl;
    }
    else if (S.at(i)/16==0){
      cout<<S.at(i)<<endl;
    }
    else if (S.at(i)/8==0){
      cout<<S.at(i)<<endl;
    }
    else if (S.at(i)/32==0){
      cout<<S.at(i)<<endl;
    }
    else if (S.at(i)/32==0){
      cout<<S.at(i)<<endl;
    }
   }
}
      
      
      
      
      
      
      
      
      

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: request for member 'at' in 'S', which is of non-class type 'int'
    8 |     if(S.at(i)/64==0){
      |          ^~
a.cc:9:15: error: request for member 'at' in 'S', which is of non-class type 'int'
    9 |       cout<<S.at(i)<<endl;
      |               ^~
a.cc:11:16: error: request for member 'at' in 'S', which is of non-class type 'int'
   11 |     else if (S.at(i)/32==0){
      |                ^~
a.cc:12:15: error: request for member 'at' in 'S', which is of non-class type 'int'
   12 |       cout<<S.at(i)<<endl;
      |               ^~
a.cc:14:16: error: request for member 'at' in 'S', which is of non-class type 'int'
   14 |     else if (S.at(i)/16==0){
      |                ^~
a.cc:15:15: error: request for member 'at' in 'S', which is of non-class type 'int'
   15 |       cout<<S.at(i)<<endl;
      |               ^~
a.cc:17:16: error: request for member 'at' in 'S', which is of non-class type 'int'
   17 |     else if (S.at(i)/8==0){
      |                ^~
a.cc:18:15: error: request for member 'at' in 'S', which is of non-class type 'int'
   18 |       cout<<S.at(i)<<endl;
      |               ^~
a.cc:20:16: error: request for member 'at' in 'S', which is of non-class type 'int'
   20 |     else if (S.at(i)/32==0){
      |                ^~
a.cc:21:15: error: request for member 'at' in 'S', which is of non-class type 'int'
   21 |       cout<<S.at(i)<<endl;
      |               ^~
a.cc:23:16: error: request for member 'at' in 'S', which is of non-class type 'int'
   23 |     else if (S.at(i)/32==0){
      |                ^~
a.cc:24:15: error: request for member 'at' in 'S', which is of non-class type 'int'
   24 |       cout<<S.at(i)<<endl;
      |               ^~
Language: C++

#include <iostream>
using namespace std;
int n;
int max_count(-1);
int max;
int main(){
	cin >> n;
	for (int i(0); i < n; i++) {
		int tmp = i+1;
		int count(0);
		while (tmp % 2 == 0) {
			tmp /= 2;
			count++;
		}
		if (count > max_count){
			max_count = count;
			max = i+1;
		}		
	}
	cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: reference to 'max' is ambiguous
   17 |                         max = i+1;
      |                         ^~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:5: note:                 'int max'
    5 | int max;
      |     ^~~
a.cc:20:17: error: reference to 'max' is ambiguous
   20 |         cout << max << endl;
      |                 ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: '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:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:5: note:                 'int max'
    5 | int max;
      |     ^~~
Language: C++

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

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main{
      |     ^~~~
a.cc:5:3: error: expected primary-expression before 'int'
    5 |   int count(0), max(-1);
      |   ^~~
a.cc:5:3: error: expected '}' before 'int'
a.cc:4:9: note: to match this '{'
    4 | int main{
      |         ^
a.cc:6:3: error: 'cin' does not name a type
    6 |   cin >> n;
      |   ^~~
a.cc:7:3: error: expected unqualified-id before 'for'
    7 |   for(int i(0); i<n; i++){
      |   ^~~
a.cc:7:17: error: 'i' does not name a type
    7 |   for(int i(0); i<n; i++){
      |                 ^
a.cc:7:22: error: 'i' does not name a type
    7 |   for(int i(0); i<n; i++){
      |                      ^
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout << max << endl;
      |   ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before '}' token
    8 |     cout<<1<<endl
      |                  ^
      |                  ;
    9 |   }
      |   ~
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.next.Int();
    int ans = 1;
    while(0==0){
      if(ans*2<=N){
        ans*=2;
      }
      else{
        break;
      }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    int N = sc.next.Int();
              ^
  symbol:   variable next
  location: variable sc of type Scanner
1 error
Language: C++

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

int main()
{

    long long N;
    cin >> N;

    int v[0];
    int cnt = 0;
    int tmp = 0;

    if (N==1){
        
    cout << 1 << endl;

    return 0;
    } 

    while (1)
    {
        tmp = pow(2, cnt);
        if (tmp > 100)
        {
            break;
        }
        else
        {
            v.push_back(tmp);

            cnt++;
        }
    }

    int imax =0;
    for (int i = 0; i < v.size(); i++)
    {
        if (v[i] <= N){
            imax = max(imax,v[i]);
        }
            
    }

    cout << imax << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:15: error: request for member 'push_back' in 'v', which is of non-class type 'int [0]'
   30 |             v.push_back(tmp);
      |               ^~~~~~~~~
a.cc:37:27: error: request for member 'size' in 'v', which is of non-class type 'int [0]'
   37 |     for (int i = 0; i < v.size(); i++)
      |                           ^~~~
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'j' was not declared in this scope
    7 |   for(int i = j; i < 129; i*=2) {
      |               ^