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

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  long long x,y;
  cin >> x >> y;
  
  long long ans = 0;
  while(x <= y)
    ans++;
  	x *= 2;
  }
  cout << ans << endl;
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int x,y;
  cin >> x >> y;
  
  int ans = 0;
  while(x <= y)
    ans++;
  	x *= 2;
  }
  cout << ans << endl;
  return 0;
}

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

#include<cstdio>
#include<iostream>
long long a,b,ans;
int main()
{
scanf("%d%d",&a,&b);
while(a<=b)
{
   a=a*2;
	ans++;
}	
cout<<ans<<endl;
return 0;
}

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

#include<stdio.h>
#include<math.h>
int main(){
  long long int x,y;
  int ans=0;
  for(i=x;i<=y;i*=2){
    ans++;
  }
  printf("%d\n",ans);
  return 0;
}

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

#include <iostream>
#include <cstdio>
#include <queue>
#include <cmath>
#include <random>
#include <fstream>

#define REP(i, N) for(int i = 0; i< N; i++)
using namespace std;
#define ll long long

int main(){
    ll X, Y;
    cin >> X >> Y;
    int i = 0;
    do{
        X *= 2;
        i++;
    }while(X < Y)
    cout << i;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: expected ';' before 'cout'
   19 |     }while(X < Y)
      |                  ^
      |                  ;
   20 |     cout << i;
      |     ~~~~
Language: C++

#include<iostream>
#include<map>
typedef long long ll;
using namespace std;
int main() {
	ll x, y;
	cin >> x >> y;
	ll ans = 0;
	whiel(x <= y;) {
		x *= 2;
		ans ++;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: expected ')' before ';' token
    9 |         whiel(x <= y;) {
      |              ~      ^
      |                     )
a.cc:9:22: error: expected primary-expression before ')' token
    9 |         whiel(x <= y;) {
      |                      ^
Language: C++

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

int main() {
    long long x, y
    cin >> x >> y;
    int ans = 0;
    while(x <= y){
        x *= 2;
        ans++;
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'cin'
    6 |     cin >> x >> y;
      |     ^~~
a.cc:8:16: error: 'y' was not declared in this scope
    8 |     while(x <= y){
      |                ^
Language: C++

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

int main(void) {
    char S[];
    int i;

    cin >> S;
    int n = strlen(S);

    for(i=0; i<n; i++){
       if(S[i] != S[i+1]){
           if(i > n-1) {
               for(int j=0; j<i; j++){
                   if(S[j] == '0') S[j] = '1';
                   else S[j] = '0';
               }
           }
                for(int j=i; j<n; j++){
                    if(S[j] == '0') S[j] = '1';
                    else S[j] = '0';
            }
       }
       
    }

    cout << i-1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: storage size of 'S' isn't known
    5 |     char S[];
      |          ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>

using namespace std;

int main()
{
  int X, Y;
  cin >> X >> Y;
  int <vector> A;
  A.push_back(X);

  for(int i=0; i<Y; i++){

    A.push_back(A[i]*2);
    if(A[i+1] > Y){
      cout << A.size() - 1 << endl;
      exit(0);
    }
  }


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'int' is not a template
   12 |   int <vector> A;
      |   ^~~
a.cc:13:5: error: request for member 'push_back' in 'A', which is of non-class type 'int'
   13 |   A.push_back(X);
      |     ^~~~~~~~~
a.cc:17:7: error: request for member 'push_back' in 'A', which is of non-class type 'int'
   17 |     A.push_back(A[i]*2);
      |       ^~~~~~~~~
a.cc:17:18: error: invalid types 'int[int]' for array subscript
   17 |     A.push_back(A[i]*2);
      |                  ^
a.cc:18:9: error: invalid types 'int[int]' for array subscript
   18 |     if(A[i+1] > Y){
      |         ^
a.cc:19:17: error: request for member 'size' in 'A', which is of non-class type 'int'
   19 |       cout << A.size() - 1 << endl;
      |                 ^~~~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main () {
    long long X, Y;
    int log_val;
    cin >> X >> Y;

    log_val = log2((double)Y) - log2(double)X);

    cout << log_val + 1 << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:38: error: expected primary-expression before 'double'
   11 |     log_val = log2((double)Y) - log2(double)X);
      |                                      ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long x,y;
int main()
{
	cin>>x>>y;
	ans=x/y;
	while(ans!=1)
	ans/=2,c++;
	cout<<c<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |         ans=x/y;
      |         ^~~
      |         abs
a.cc:9:16: error: 'c' was not declared in this scope
    9 |         ans/=2,c++;
      |                ^
a.cc:10:15: error: 'c' was not declared in this scope
   10 |         cout<<c<<endl;
      |               ^
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc=new Scanner(System.in);

		long x=sc.nextInt();
		long y=sc.nextInt();

		long counter=1;

		while(true) {

			x*=2;

			if(y>x) {
				counter++;
			}if else(y==x) {
              	counter++;
				break;
			}else{
            	break;
            }

		}

		System.out.println(counter);

	}


}


Compiler output:
Main.java:19: error: '(' expected
			}if else(y==x) {
			   ^
Main.java:19: error: illegal start of expression
			}if else(y==x) {
			    ^
Main.java:19: error: not a statement
			}if else(y==x) {
			        ^
Main.java:19: error: ';' expected
			}if else(y==x) {
			              ^
Main.java:22: error: 'else' without 'if'
			}else{
			 ^
5 errors
Language: C++

#include<bits/stdc++.h>
using namespcae std;
int x,y,ans,c;
int main()
{
    cin>>x>>y;
    c=x;
    for(int i=0;;i++)
    {
        c*=2;
        if(c>=y)break;
        ans++;
    }
    cout<<ans<<endl;
    
    
    return 0;
}

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

#inclucde<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
  ll x, y; cin >> x >> y;
  for(int i=0;;i++){
    if (y < x) {cout << i << endl; return 0;}
    y /= 2;    
  }
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclucde; did you mean #include?
    1 | #inclucde<bits/stdc++.h>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:12: error: 'cin' was not declared in this scope
    5 |   ll x, y; cin >> x >> y;
      |            ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclucde<bits/stdc++.h>
a.cc:7:17: error: 'cout' was not declared in this scope
    7 |     if (y < x) {cout << i << endl; return 0;}
      |                 ^~~~
a.cc:7:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:30: error: 'endl' was not declared in this scope
    7 |     if (y < x) {cout << i << endl; return 0;}
      |                              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclucde<bits/stdc++.h>
Language: C++

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

int main()
{
    long long x,y,a=0;
    cin>>x>>y;
    cout<<(ll)log2(y/x)+1<<endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'll' was not declared in this scope
    8 |     cout<<(ll)log2(y/x)+1<<endl;
      |            ^~
Language: Java

import java.util.*;

class Main{
public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	long x = sc.nextLong();
	long y = sc.nextLong();
	int ans = 1;
	while(2*x<=y) {
		x *= 2;
		ans = x;
	}
	System.out.println(ans);
}
}

Compiler output:
Main.java:11: error: incompatible types: possible lossy conversion from long to int
		ans = x;
		      ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define REP(i,x,n) for(int i = x; i < n; i++)
#define MAX 100
vector<pair<int,int> > red,blue;
int used[MAX];
long long X,Y;
// int H;
// vector<int> thrower;

// int Rx[MAX];
// int Ry[MAX];
// int Bx[MAX];
// int By[MAX];
// int dp[1000000001];

int main(void){
    // Your code here!
    cin >> X >> Y;
    
    
    
    int ans = 0;
    // cout << Y / X;
    ans = log2(Y / X) + 1;
    // int a,b;
    // REP(i,0,N){
    //     cin >> a >> b;
    //     red.push_back({a,b});
    // // cin >> C[i] >> S[i] >> F[i];
    // }
    
    // REP(i,0,N){
    //     cin >> a >> b;
    //     // cout << blue[0].first << endl;
    //     blue.push_back({a,b});
    // // cin >> C[i] >> S[i] >> F[i];
    // }
    
    // sort(blue.begin(),blue.end());
    
    // int ans = 0;
    // // cout << blue[0].first << endl;
    // for (auto b : blue) {
    //     int maxRy = -1; 
    //     int temp = -1;
        
    //     REP(i,0,N) {
    //         if (used[i] == 1) continue;
    //         if (red[i].first <= b.first && red[i].second <= b.second) {
    //             if (red[i].second > maxRy) {
    //                 temp = i;
    //                 maxRy = red[i].second;
    //             }
    //         }
            
    //     }
    //     if (temp != -1){
    //         ans++;
    //         used[temp] = 1;
    //     }
        
    // }
    
    cout << ans << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:11: error: 'log2' was not declared in this scope
   27 |     ans = log2(Y / X) + 1;
      |           ^~~~
Language: Java

import java.util.Scanner;
import java.util.Arrays;
public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        double x=sc.nextLong();
        double y=sc.nextLong();
        if(x==1&&y<100000000000000&&100<y){
            System.out.println((int)(Math.log(y/2)/Math.log(2)+1));
        }else{
            System.out.println((int)(Math.log(y/x)/Math.log(2)+1));
        }
    }
}


Compiler output:
Main.java:8: error: integer number too large
        if(x==1&&y<100000000000000&&100<y){
                   ^
1 error
Language: C

#include<stdio.h>
#include<stdlib.h>
 
int main(){
  int X, Y, a;
  scanf("%d%d", &X, &Y);
  a=Y/X; 
  for(i=1;;i++){
    if(a>>i==0)break;
  }
  printf("%d\n", i);
}


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

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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    long long x = 0;
    long long y = 0;
    cin >> x >> y;

    // An = x * 2 ^ (n - 1)より
    // y >= x * 2 ^ (n - 1
    // y / x >= 2 ^ (n - 1)
    // log(y) - log(x) >= n - 1
    // log(y) - log(x) + 1 >= n
    // を満たす最大の整数nを求めれば良さそう
    // だけどなんか計算誤差が出てるのがACできないサンプルが1個だけあるので愚直に解くことにする。。

    // long long n = floor(log2(y) - log2(x) + 1);
    // cout << n << endl;

    long long i = 0;
    while (x < y)
    {
        x *= 2;
        ++i;
    }

    cout << i << endl;

    return 0;
}


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

#include <iostream>
using namespace std;
int main()
{
	long long x,y;
	long long div;
	int res=0;
	cin>>x>>y;
	div=x;
	while(x<=y)
	{
		res++;
		x*=2
	}
	cout<<res<<endl;
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;  
  
inline ll read()  
{  
    long long f=1,sum=0;  
    char c=getchar();  
    while (c<'0' || c>'9')  
    {  
        if (c=='-') f=-1;  
        c=getchar();  
    }     
    while (c>='0' && c<='9')  
    {  
        sum=sum*10+c-'0';  
        c=getchar();  
    }  
    return sum*f;  
}  
int main()  
{  
    ll l=read(),r=read();  
    int ans=0;  
    while (r>=l) l*=2,ans++;   
    cout<<ans;  
    return 0;  
}  


Compiler output:
a.cc:4:8: error: 'll' does not name a type
    4 | inline ll read()
      |        ^~
a.cc: In function 'int main()':
a.cc:22:5: error: 'll' was not declared in this scope
   22 |     ll l=read(),r=read();
      |     ^~
a.cc:24:12: error: 'r' was not declared in this scope
   24 |     while (r>=l) l*=2,ans++;
      |            ^
a.cc:24:15: error: 'l' was not declared in this scope
   24 |     while (r>=l) l*=2,ans++;
      |               ^
Language: C++

using namespace std;

using ll = long long;

#define reps(i,s,n) for(int (i)=(s) ; (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)

int main(){
    ll x,y,d;
    ll n ;
    cin >> x >> y;
    d = y/x;
    int cnt = 0;
    n = 1;
    while(n <= d){
        n*=2;
        cnt++;
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'cin' was not declared in this scope
   11 |     cin >> x >> y;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:19:5: error: 'cout' was not declared in this scope
   19 |     cout << cnt << endl;
      |     ^~~~
a.cc:19:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:20: error: 'endl' was not declared in this scope
   19 |     cout << cnt << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define PB push_back
using namespace std;
typedef pair<int, int> P1;
typedef pair<int, pair<int, int> > P2;
static const int INF = 1ll<<60;
static const double EPS = 0.0000001;
static const int dx[] = { 1, -1, 0, 0, };
static const int dy[] = { 0, 0, 1, -1 };
static const int mod = 1000000007;

unsigned double X,Y;

signed main(){
    cin>>X>>Y;
    cout<<(unsigned int)(log2(Y)-log2(X)+EPS)+1<<endl;
}


Compiler output:
a.cc:15:1: error: 'unsigned' specified with 'double'
   15 | unsigned double X,Y;
      | ^~~~~~~~
a.cc:15:1: error: 'unsigned' specified with 'double'
Language: C++

#include<iostream>

int main(){
	// 入力用変数
	double x,y;
	//unsigned long long x,y;
	
	// その他の変数
	int counter=0;
	
	std::cin >> x >> y;
	
	//--------------------------------
	// ここから
	//--------------------------------
	
	do{
		counter++;
		x*=2;
	}while(x<=y)
	
	std::cout << counter;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: expected ';' before 'std'
   20 |         }while(x<=y)
      |                     ^
      |                     ;
   21 | 
   22 |         std::cout << counter;
      |         ~~~
Language: C++

    #include <iostream>
     
    using namespace std;
    using ll = long long;
     
    int main()
    {
      ll A, B;
      cin >> A >>B;
      int ans = 1;
      for(;B >= A;ans++){
      	A *= 2;
      }
      cout << ans << endl;
    return 0;
    }

#include <iostream>

using namespace std;
using ll = long long;

int main()
{
  ll A, B;
  cin >> A >>B;
  int ans = 0;
  for(;B >= A;ans++){
  	A *= 2LL;
  }
  cout << ans << endl;
return 0;
}

提出情報


Compiler output:
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main()
      |     ^~~~
a.cc:6:9: note: 'int main()' previously defined here
    6 |     int main()
      |         ^~~~
a.cc:35:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
   35 | 提出情報
      | ^~~~~~~~
Language: C++

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

int main()
{
	int x,y,len=0;
	cin>>x>>y;
	
    while(x<y)
    do{
    	x*=2;
    	len++;
    }
    
    cout<<len<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: expected 'while' before 'cout'
   17 |     cout<<len<<endl;
      |     ^~~~
a.cc:17:5: error: expected '(' before 'cout'
   17 |     cout<<len<<endl;
      |     ^~~~
      |     (
a.cc:17:20: error: expected ')' before ';' token
   17 |     cout<<len<<endl;
      |     ~~~~           ^
      |                    )
Language: C

#include <stdio.h>
typedef long long ll;


int main()
{
    ll x,y;
    scanf("%lld %lld",&x,&y);

    for(int i=1;i<n;i++)
    {
        x *= 2;
        if(x>y)
        {
            printf("%d\n",i);
            return 0;
        }
    }
    
    return 0;
}


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

#include <iostream>

int main(){
  long long x, y;
  std::cin >> x >> y;
  int i = 0;
  long long now = x;
  while(now <= y){
    i++;
    now *= 2;
  }
  std::cout << i << endl;
  
  return 0;
}

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

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

inline ll read() 
{
 	long long f = 1,sum = 0;
	char c = getchar(); 
	while (c < '0' || c>'9') 
	{ 
		if (c == '-') f = -1; 
		c = getchar(); 
	}
	while (c >= '0' && c <= '9') 
	{	
 		sum=sum*10+c-'0'; 
		c=getchar(); 
    }
	return sum * f;  
} 
int main() 
{ 
 	ll l = read(), r = read();	
	int ans = 0; 
	while (r >= l) l *= 2, ans++;
	cout << ans;
	return 0; 
}

Compiler output:
a.cc:4:8: error: 'll' does not name a type
    4 | inline ll read()
      |        ^~
a.cc: In function 'int main()':
a.cc:22:9: error: 'll' was not declared in this scope
   22 |         ll l = read(), r = read();
      |         ^~
a.cc:24:16: error: 'r' was not declared in this scope
   24 |         while (r >= l) l *= 2, ans++;
      |                ^
a.cc:24:21: error: 'l' was not declared in this scope
   24 |         while (r >= l) l *= 2, ans++;
      |                     ^
Language: C++

V#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b;
	cin>>a>>b;
	cout<<int(log2(b/a))+1;
	return 0;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | V#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'V' does not name a type
    1 | V#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin>>a>>b;
      |         ^~~
a.cc:7:9: error: 'cout' was not declared in this scope
    7 |         cout<<int(log2(b/a))+1;
      |         ^~~~
a.cc:7:19: error: 'log2' was not declared in this scope
    7 |         cout<<int(log2(b/a))+1;
      |                   ^~~~
Language: C++

#include<iostream>
 2 using namespace std;
 3 long long a,b;
 4 int main()
 5 {
 6     cin>>a>>b;
 7     long long sum = 0;
 8     while(a<=b)
 9     {
10         sum++;
11         a*=2;
12     }
13     cout<<sum<<endl;
return 0;
 }

Compiler output:
a.cc:2:2: error: expected unqualified-id before numeric constant
    2 |  2 using namespace std;
      |  ^
a.cc:3:2: error: expected unqualified-id before numeric constant
    3 |  3 long long a,b;
      |  ^
a.cc:4:2: error: expected unqualified-id before numeric constant
    4 |  4 int main()
      |  ^
Language: C++

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

int x,y;
int ans;
int main()
{
	cin>>x>>y;
	while(x<=y)
	{
		x*=2;
		ans++;
	}
	cout<<ans;
	return 0;
}#include <bits/stdc++.h> 
using namespace std;

int x,y;
int ans;
int main()
{
	cin>>x>>y;
	while(x<=y)
	{
		x*=2;
		ans++;
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:16:2: error: stray '#' in program
   16 | }#include <bits/stdc++.h>
      |  ^
a.cc:16:3: error: 'include' does not name a type
   16 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:19:5: error: redefinition of 'int x'
   19 | int x,y;
      |     ^
a.cc:4:5: note: 'int x' previously declared here
    4 | int x,y;
      |     ^
a.cc:19:7: error: redefinition of 'int y'
   19 | int x,y;
      |       ^
a.cc:4:7: note: 'int y' previously declared here
    4 | int x,y;
      |       ^
a.cc:20:5: error: redefinition of 'int ans'
   20 | int ans;
      |     ^~~
a.cc:5:5: note: 'int ans' previously declared here
    5 | int ans;
      |     ^~~
a.cc:21:5: error: redefinition of 'int main()'
   21 | 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);
        Long X = sc.nextLong();
        Long Y = sc.nextLong();
        Long sum = X * 2;//A2
        if(sum > Y){
            System.out.println("1");
            System.exit(0);
        }else{
            int count = 2;
        }
        //Long sum = X * 2;
        //int count = 2;
        /*
        while(true){
            sum = sum * 2;
            if(sum > Y){
                System.out.println(count);
                System.exit(0);
            }
            count++;
            if((X-1) == count){
                System.out.println(count);
                System.exit(0);
            }
            System.out.println("A" + count + "=" + sum);
        }
        */
        while(true){
            sum = sum * 2;
            if(sum > Y){
                if(count == 2){
                    System.out.println("2");
                    System.exit(0);
                }else{
                    System.out.println(count);
                    System.exit(0);
                }
            }
            count++;
            /*
            if(X == count){
                System.out.println(count);
                System.exit(0);
            }
            */
        }
    }
}

Compiler output:
Main.java:34: error: cannot find symbol
                if(count == 2){
                   ^
  symbol:   variable count
  location: class Main
Main.java:38: error: cannot find symbol
                    System.out.println(count);
                                       ^
  symbol:   variable count
  location: class Main
Main.java:42: error: cannot find symbol
            count++;
            ^
  symbol:   variable count
  location: class Main
3 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'll' was not declared in this scope
    5 |         ll A,B;
      |         ^~
a.cc:6:16: error: 'A' was not declared in this scope
    6 |         cin >> A >> B;
      |                ^
a.cc:6:21: error: 'B' was not declared in this scope
    6 |         cin >> A >> B;
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std:
int main()
{
  	ll A,B;
  cin >> A >> B;
  for(int i = 1; ;i++){
  	A *= 2;
    if(A > B){
    	cout << i << endl;
        return 0;
    }
  }
	return 0;
}

Compiler output:
a.cc:2:20: error: expected ';' before ':' token
    2 | using namespace std:
      |                    ^
      |                    ;
a.cc:2:20: error: expected unqualified-id before ':' token
Language: C++

#include<iostream>
using namespace std;
int main()
{
long long a, b;
cin >> a >> b;
int cnt = 0,x=a;
while()
{a*=2;
cnt++;}
cout<<cnt;
system("pause");
return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main()
{
        long long x,y,s=0,i,ii=1;
        scanf("%lld%lld",&x,&y);
        i=x;
        while(i<=y)
        {
                s++;
                i*=2;
        }
        printf("%lld",s);
        return 0;
}
~                                                                               
~                  

Compiler output:
a.cc:17:1: error: expected class-name before '~' token
   17 | ~
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long x,y,s=0,i,ii=1;
	scanf("%lld%lld",&x,&y);
	i=j=x;
	while(i<=y)
	{
		if(abs(i)-1<ii)
			continue;
		s++;
		ii++;
		i*=2;
	}
	printf("%lld",s);
	return 0;
}


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

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
 
int main() {
	float  x,y;
	cin>>x>>y;
	
	vector <long long int >vec;
	for(int i=0;pow(2,i)<=1e18;i++)
	  {
	  	vec.push_back(pow(2,i));
	  }
	  //cout<<y/x;
	 int ans=lower_bound(vec.begin(),vec.end(),y/x)-vec.begin();
	 //cout<<ans<<"\n";
	 
	if(binary_search(vec.begin(),vec.end(),y/x)==true)
	  {
	  	ans=ans+1<<"\n";
	  	//return 0;
	  	
	  }
	else{	
	  	
	  	//cout<<ans<<"\n";
	  }
	 if(ans==1)
	   cout<<0;
	 else
	   cout<<ans;
	// your code goes here
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:26: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
   22 |                 ans=ans+1<<"\n";
      |                     ~~~~~^~~~~~
      |                        |   |
      |                        int const char [2]
Language: C++

#include <iostream>
using namespace std;
int main()
{
	unsigned long  X, Y, ;
	int index = 0;
	cin >> X >> Y;
	for (int i = 1; i <= Y; i++)
	{
		if (X > Y)
		{
			index = i - 1;
			break;
		}
		X *= 2;
	}
	cout << index;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:30: error: expected unqualified-id before ';' token
    5 |         unsigned long  X, Y, ;
      |                              ^
Language: C++

#include <iostream>
#include <conio.h> 
using namespace std;
int main()
{
	double X, Y, index;
	cin >> X >> Y;
	for (int i = 1; i <= Y; i++)
	{
		if (X > Y)
		{
			index = i - 1;
			break;
		}
		X *= 2;
	}
	cout << index;
	_getch();
}

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

int main(){
  long long int X, Y;
  scanf("%lld%lld", &X, &Y);
  int count = 0;
  while (X <= Y) {
    X *= 2;
    count++;
  }
  printf("%d\n", count);
}


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

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;

int main()
{
	int n, a, b;
	scanf("%d %d %d",&n, &a, &b);
	int r = 0
	for(int i = 1; i <= n; i++
	{
		int c = 0, t = i;
		for(int j = 0; j < 5; j++)
		{
			c += t % 10;
			t /= 10;
		}
		if(a <= c && c <= b)
		{
			r += i;
		}
		printf("%d\n",r);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: expected ',' or ';' before 'for'
   14 |         for(int i = 1; i <= n; i++
      |         ^~~
a.cc:14:24: error: 'i' was not declared in this scope
   14 |         for(int i = 1; i <= n; i++
      |                        ^
Language: C++

include <stdio.h>

int main(void)
{
	int i=1,c=0;
	unsigned long long a,b;
	scanf("%d %d",&a,&b);
	while(i){
		if(a<=b){
			c=c+1;
		}
		if(a>b){
			i=0;
		}
		a=a*2;
	}
	printf("%d",c);
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
Language: C

include <stdio.h>

int main(void)
{
	int i=1,c=0;
	unsigned long long a,b;
	scanf("%d %d",&a,&b);
	while(i){
		if(a<=b){
			c=c+1;
		}
		if(a>b){
			i=0;
		}
		a=a*2;
	}
	printf("%d",c);
	return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

include <stdio.h>

int main(void)
{
	int i=1,c=0;
	unsigned long long a,b;
	scanf("%18d0 %18d0",&a,&b);
	while(i){
		if(a<=b){
			c=c+1;
		}
		if(a>b){
			i=0;
		}
		a=a*2;
	}
	printf("%d",c);
	return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C++

include <stdio.h>

int main(void)
{
	int i=1,c=0;
	unsigned long long a,b;
	scanf("%18d %18d",&a,&b);
	while(i){
		if(a<=b){
			c=c+1;
		}
		if(a>b){
			i=0;
		}
		a=a*2;
	}
	printf("%d",c);
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
Language: C

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

int main(void) {
	unsigned double x,y,i=0;
	
	scanf("%lf %lf",&x,&y);
	
	while((x*pow(2,i))<=y){
		i++;
		}
		
	printf("%.0lf",i);
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:18: error: both 'unsigned' and 'double' in declaration specifiers
    5 |         unsigned double x,y,i=0;
      |                  ^~~~~~
Language: C++

#include <iostream>
using namespace std;


int main()
{
	long long int X, Y;
	cin >> X >> Y;
	Y /= X;
	long long int two = 0;
	while (1) {
		if (pow(2, two) > Y) break;
		two++;
	}
	cout << two << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'pow' was not declared in this scope
   12 |                 if (pow(2, two) > Y) break;
      |                     ^~~
Language: C++

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

int main(){
	double X,Y;
  	scanf("%lf %lf",&X,&Y);
  	int t=(int)log2(Y-X);
  	printf("%d",t+1);
	return(0)
}
  

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

#include<iostream>
using namespace std;
int main() {
  	int x, y;
  	cin >> x >> y;
  	int a;
  	a = y / x;
  	int j = 0;
  	int sum = 0;
  	for(int i = 1; i <= a; j++;){
      	sum++;
      	i += j;
    }
  	cout << sum << endl;
  	return 0;
}     	

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

#include<iostream>
using namespace std;
int main() {
  	int x, y;
  	cin >> x >> y;
  	int a;
  	a = y / x;
  	int j = 0;
  	int sum = 0;
  	for(int i = 1; i <= a; ;){
      	sum++;
      	i += j;
      	j++;
    }
  	cout << sum << endl;
  	return 0;
}     	

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

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

string mul_by_2(string s) {
	char c[20];
	int j = 0;
	int tmp;
	int carry = 0;
	int len = s.length();
	for (int i = len - 1;i > -1;i--) {
		tmp = (s[i] - '0') * 2 + carry;
		c[j++] = tmp % 10+'0';
		carry = tmp / 10;
	}
	if (carry > 0) {
		c[j++] = carry + '0';
	}
	c[j] = '\0';
	string t(c);
	reverse(t.begin(), t.end());
	return t;
}
int main() {
	string x, y;
	cin >> x >> y;
	int cnt = 0;
	int y_len = y.length();
	while (x.length()<y_len||x.compare(y)<=0) {
		cnt++;
		x = mul_by_2(x);
	}
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'std::string mul_by_2(std::string)':
a.cc:23:9: error: 'reverse' was not declared in this scope
   23 |         reverse(t.begin(), t.end());
      |         ^~~~~~~
Language: C++

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

string mul_by_2(string s) {
	char c[20];
	int j = 0;
	int tmp;
	int carry = 0;
	int len = s.length();
	for (int i = len - 1;i > -1;i--) {
		tmp = (s[i] - '0') * 2 + carry;
		c[j++] = tmp % 10+'0';
		carry = tmp / 10;
	}
	if (carry > 0) {
		c[j++] = carry + '0';
	}
	c[j] = '\0';
	string t(c);
	reverse(t.begin(), t.end());
	return t;
}
int main() {
	string x, y;
	cin >> x >> y;
	int cnt = 0;
	int y_len = y.length();
	while (x.length()<y_len||x.compare(y)<=0) {
		cnt++;
		x = mul_by_2(x);
	}
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'std::string mul_by_2(std::string)':
a.cc:22:9: error: 'reverse' was not declared in this scope
   22 |         reverse(t.begin(), t.end());
      |         ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	// ----- 変数宣言 -----
	__int64 x, y;
	int length = 0;

	// ----- 入力 -----
	cin >> x >> y;

	// ----- 計算 -----

	// x<=y で終わり
	while (x<=y) {

		// 2倍する
		x *= 2;

		// 長さを足す
		length += 1;
	}

	// ----- 出力 -----
	cout << length << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    6 |         __int64 x, y;
      |         ^~~~~~~
      |         __int64_t
a.cc:10:16: error: 'x' was not declared in this scope
   10 |         cin >> x >> y;
      |                ^
a.cc:10:21: error: 'y' was not declared in this scope
   10 |         cin >> x >> y;
      |                     ^
Language: C++

#include <cstdio>
using namespace std;
char s[100005];
int main(){
	int i;
	unsigned __int64 x, y;
	
	scanf("%I64u %I64u", &x, &y);
	i=0;
	while(x<=y and x<(x<<1)){
		x<<=1;
		i++;
	}
	printf("%d", i);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: expected initializer before 'x'
    6 |         unsigned __int64 x, y;
      |                          ^
a.cc:8:31: error: 'x' was not declared in this scope
    8 |         scanf("%I64u %I64u", &x, &y);
      |                               ^
a.cc:8:35: error: 'y' was not declared in this scope
    8 |         scanf("%I64u %I64u", &x, &y);
      |                                   ^
Language: C++

#include<bits/stdc+.h>
using namespace std;
int main()
{
    long long x,y,t=0;
       cin>>x>>y;
    while(true)
    {
        if(x>y)break;
        x*=2;
        t++;
    }
    cout<<t<<endl;
}


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

#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
using namespace std;
#define ll long long
#define inf 0x7fffffff
ll ans;
int main()
{
	ll a,b;
	cin>>a>>b;
	for(ll i=a;i<=b;i*=2;) ans++;
	cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: expected ')' before ';' token
   13 |         for(ll i=a;i<=b;i*=2;) ans++;
      |            ~                ^
      |                             )
a.cc:13:30: error: expected primary-expression before ')' token
   13 |         for(ll i=a;i<=b;i*=2;) ans++;
      |                              ^
Language: C

#include<stdio.h>
#include<string.h>
int main(){
	char S[100000];
	scanf("%s",S);
	int length=strlen(S);
	int K = length;
  	for (int i=0;i<length-1;i++){
		if ( S[i+1] != S[i] ) {
			if( 2*(i+1) < length /*&& length -(i+1) < K*/) K=length-(i+1);
			else　K=i+1;
		}
	}
	printf("%d",K);
}


Compiler output:
main.c: In function 'main':
main.c:11:29: error: stray '\343' in program
   11 |                         else<U+3000>K=i+1;
      |                             ^~~~~~~~
Language: C

#include<stdio.h>
#include<string.h>
int main(){
	char S[100000];
	scanf("%s",S);
	int length=(int K = strlen(S));
	for (int i=0;i<length-1;i++){
		if ( S[i+1] != S[i] ) {
			if( 2*(i+1) < length /*&& length -(i+1) < K*/) K=length-(i+1);
			else　K=i+1;
		}
	}
	printf("%d",K);
}


Compiler output:
main.c: In function 'main':
main.c:6:24: error: expected ')' before 'K'
    6 |         int length=(int K = strlen(S));
      |                    ~   ^~
      |                        )
main.c:6:39: error: expected expression before ';' token
    6 |         int length=(int K = strlen(S));
      |                                       ^
main.c:9:72: error: 'K' undeclared (first use in this function)
    9 |                         if( 2*(i+1) < length /*&& length -(i+1) < K*/) K=length-(i+1);
      |                                                                        ^
main.c:9:72: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:29: error: stray '\343' in program
   10 |                         else<U+3000>K=i+1;
      |                             ^~~~~~~~
Language: C

#include<stdio.h>
#include<string.h>
int main(){
	char S[100000];
	scanf("%s",S);
	int length=K=strlen(S);
	for (int i=0;i<length-1;i++){
		if ( S[i+1] != S[i] ) {
			if( 2*(i+1) < length /*&& length -(i+1) < K*/) K=length-(i+1);
			else　K=i+1;
		}
	}
	printf("%d",K);
}


Compiler output:
main.c: In function 'main':
main.c:6:20: error: 'K' undeclared (first use in this function)
    6 |         int length=K=strlen(S);
      |                    ^
main.c:6:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:29: error: stray '\343' in program
   10 |                         else<U+3000>K=i+1;
      |                             ^~~~~~~~
Language: C++

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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	string s; cin>>s;
	int ans = s.size();
	for(int i = 1; i < n; i++){
		if(s[i] != s[i - 1])ans = min(ans, max(i, n - i));
	}
	cout<<ans<<'\n';

	return 0;
}

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

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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	string s; cin>>s;
	int ans = n;
	for(int i = 1; i < n; i++){
		if(s[i] != s[i - 1])ans = min(ans, max(i, n - i));
	}
	cout<<ans<<'\n';

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: 'n' was not declared in this scope
   15 |         int ans = n;
      |                   ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
  char S[100001];
  scanf("%s", S);
  
  int ans = strlen(S);
  int N = ans;
  
  for (int i = 0; i < N - 1; i++) {
    if (S[i] != S[i - 1]) ans = min(ans, max(i + 1, N - i - 1)));
  }
  
  printf("%d\n", ans);
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:64: error: expected ';' before ')' token
   14 |     if (S[i] != S[i - 1]) ans = min(ans, max(i + 1, N - i - 1)));
      |                                                                ^
      |                                                                ;
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
  char S[100001];
  scanf("%s", s);
  
  int ans = strlen(S);
  int N = ans;
  
  for (int i = 0; i < N - 1; i++) {
    if (S[i] != S[i - 1]) ans = min(ans, max(i + 1, N - i - 1)));
  }
  
  printf("%d\n", ans);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 's' was not declared in this scope
    8 |   scanf("%s", s);
      |               ^
a.cc:14:64: error: expected ';' before ')' token
   14 |     if (S[i] != S[i - 1]) ans = min(ans, max(i + 1, N - i - 1)));
      |                                                                ^
      |                                                                ;
Language: C++

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

int ans=1000005;

signed main()
{
	string s;
	cin>>s;
	for (int i=1;i<=s.size()-1;i++)
	{
		if (s[i]!=s[i-1])  ans=min(ans,max(s.size()-i,i));
	}
	cout<<ans<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:51: error: no matching function for call to 'max(std::__cxx11::basic_string<char>::size_type, int&)'
   12 |                 if (s[i]!=s[i-1])  ans=min(ans,max(s.size()-i,i));
      |                                                ~~~^~~~~~~~~~~~~~
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:   template argument deduction/substitution failed:
a.cc:12:51: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   12 |                 if (s[i]!=s[i-1])  ans=min(ans,max(s.size()-i,i));
      |                                                ~~~^~~~~~~~~~~~~~
/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, 2 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, 2 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:   template argument deduction/substitution failed:
a.cc:12:51: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   12 |                 if (s[i]!=s[i-1])  ans=min(ans,max(s.size()-i,i));
      |                                                ~~~^~~~~~~~~~~~~~