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

#include<bits/stdc++.h>
using namespace std;
void main() {
    ll n; cin >> n;
    ll ans = 1;
    while (n > 1) {
        n /= 2;
        ans *= 2;
        ans++;
    }
    cout<<ans;
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:5: error: 'll' was not declared in this scope
    4 |     ll n; cin >> n;
      |     ^~
a.cc:4:18: error: 'n' was not declared in this scope; did you mean 'yn'?
    4 |     ll n; cin >> n;
      |                  ^
      |                  yn
a.cc:5:7: error: expected ';' before 'ans'
    5 |     ll ans = 1;
      |       ^~~~
      |       ;
a.cc:8:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |         ans *= 2;
      |         ^~~
      |         abs
a.cc:11:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     cout<<ans;
      |           ^~~
      |           abs
Language: C++

 #include <bits/stdc++.h>
 using namespace std;
 int main() {
     long long n;
     long long ans = 1;
     cin >> n;
     while (a <= n){
         ans = ans*2;
     }
     cout << ans-1 << endl;
}

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

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

int main() {
	long x;
  	cin >> x;
  	long ans = 0;
    for(long i = 0; h>1; i++){
      h=h/2;
      ans++;
    }
  	cout << ans*2+1 << endl;
}



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

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

int main() {
	long x;
  	cin >> x;
  	long ans = 0
    for(long i = 0; h>1; i++){
      h=h/2;
      ans++;
    }
  	cout << ans*2+1 << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
    9 |     for(long i = 0; h>1; i++){
      |     ^~~
a.cc:9:21: error: 'h' was not declared in this scope
    9 |     for(long i = 0; h>1; i++){
      |                     ^
a.cc:9:26: error: 'i' was not declared in this scope
    9 |     for(long i = 0; h>1; i++){
      |                          ^
Language: C++

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

int main() {
	long h;
  	cin >> h;
  	long ans = 0
    for(long i = 0; h=0; i++){
      h=h/2;
      ans++;
    }
  	cout << ans*2+1 << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
    9 |     for(long i = 0; h=0; i++){
      |     ^~~
a.cc:9:26: error: 'i' was not declared in this scope
    9 |     for(long i = 0; h=0; i++){
      |                          ^
Language: C++

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

int main() {
	long h;
  	cin >> h;
  	long ans = 0
    for(long i = 0; h=0; i++){
      h=h/2;
      ans++;
    }
  	cout << ans*2 << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
    9 |     for(long i = 0; h=0; i++){
      |     ^~~
a.cc:9:26: error: 'i' was not declared in this scope
    9 |     for(long i = 0; h=0; i++){
      |                          ^
Language: C++

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

int main() {
	long h;
  	cin >> h;
  	long ans = 0
    for(long i = 0; h=0; i++){
      h=h/2;
      ans++
    }
  	cout << ans*2 << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
    9 |     for(long i = 0; h=0; i++){
      |     ^~~
a.cc:9:26: error: 'i' was not declared in this scope
    9 |     for(long i = 0; h=0; i++){
      |                          ^
Language: C++

using namespace std;
using lint = long;
using ll = long long;
#define rep(i,n) for(lint (i) = 0;(i) < (lint)(n);(i)++)
#define repInRange(i,start,end) for(lint (i) = (start);(i) < (end);++(i))
#define pb push_back
using Vecint = vector<lint>;
using Llint = list<lint>;

lint pow(lint a,lint b) {
	lint ret = 1;
  	rep(i,b) {
		ret *= a;
	}
	return ret;
}

void Main() {
	lint H;
  	cin >> H;
	cout << pow(2,(lint)(log2(H)+1)) - 1 << '\n';
}

signed main() {
	Main();
	return 0;
}

Compiler output:
a.cc:7:16: error: 'vector' does not name a type
    7 | using Vecint = vector<lint>;
      |                ^~~~~~
a.cc:8:15: error: 'list' does not name a type; did you mean 'lint'?
    8 | using Llint = list<lint>;
      |               ^~~~
      |               lint
a.cc: In function 'void Main()':
a.cc:20:9: error: 'cin' was not declared in this scope
   20 |         cin >> H;
      |         ^~~
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:21:9: error: 'cout' was not declared in this scope
   21 |         cout << pow(2,(lint)(log2(H)+1)) - 1 << '\n';
      |         ^~~~
a.cc:21:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:30: error: 'log2' was not declared in this scope
   21 |         cout << pow(2,(lint)(log2(H)+1)) - 1 << '\n';
      |                              ^~~~
Language: C++

using namespace std;
using lint = long;
using ll = long long;
#define rep(i,n) for(lint (i) = 0;(i) < (lint)(n);(i)++)
#define repInRange(i,start,end) for(lint (i) = (start);(i) < (end);++(i))
#define pb push_back
using Vecint = vector<lint>;
using Llint = list<lint>;

lint pow(lint a,lint b) {
	lint ret = 1;
  	rep(i,b) {
		ret *= a;
	}
	return ret;
}

void Main() {
	lint H;
  	cin >> H;
	cout << pow(2,(lint)(log2(H)+1)) - 1 << '\n';
}

signed main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	Main();
	return 0;
}

Compiler output:
a.cc:7:16: error: 'vector' does not name a type
    7 | using Vecint = vector<lint>;
      |                ^~~~~~
a.cc:8:15: error: 'list' does not name a type; did you mean 'lint'?
    8 | using Llint = list<lint>;
      |               ^~~~
      |               lint
a.cc: In function 'void Main()':
a.cc:20:9: error: 'cin' was not declared in this scope
   20 |         cin >> H;
      |         ^~~
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:21:9: error: 'cout' was not declared in this scope
   21 |         cout << pow(2,(lint)(log2(H)+1)) - 1 << '\n';
      |         ^~~~
a.cc:21:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:30: error: 'log2' was not declared in this scope
   21 |         cout << pow(2,(lint)(log2(H)+1)) - 1 << '\n';
      |                              ^~~~
a.cc: In function 'int main()':
a.cc:25:9: error: 'cin' was not declared in this scope
   25 |         cin.tie(nullptr);
      |         ^~~
a.cc:25:9: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:9: error: 'ios' has not been declared
   26 |         ios::sync_with_stdio(false);
      |         ^~~
Language: C++

#include <stdio.h>
#include <algorithm>
using namespace std;
using ll = long long;

ll h;
ll rec(ll x) {
	if (x == 1)
		return 1;
	return rec(x / 2) * 2 + 1;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namesace std;
int main(){
  long long n;
  long long k=1;
  while(k<=n){
    k*=2;
  }
  cout<<k-1<<endl;
  return(0);
}

  

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesace'
    2 | using namesace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   cout<<k-1<<endl;
      |   ^~~~
      |   std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |   cout<<k-1<<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 <cmath>
#include <iostream>
#include <string>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <algorithm>

#define rep(i, n) for(long long i = 0; i < n; i++)

const int MIN = 200001;
const int MOD = 1000000007;
const long long MAX = 1e15 + 9;

int main() {
	unsigned long long h, r = 1, s = 0;
	
	cin >> h;
	
	while (h > 1) {
		h /= 2;
		r *= 2;
		s += r;
	}
	
	cout << (s + 1) << endl;
	
	return 0;
}

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

#include <iostream>

using namespace std;

ll solve(ll n)
{
  if (n == 1) return 1;
  return 1 + 2 * solve(n/2);
}

int main(int argc, char** argv) {
  ll n; cin >> n;
  cout << solve(n) << endl;
}


Compiler output:
a.cc:5:1: error: 'll' does not name a type
    5 | ll solve(ll n)
      | ^~
a.cc: In function 'int main(int, char**)':
a.cc:12:3: error: 'll' was not declared in this scope
   12 |   ll n; cin >> n;
      |   ^~
a.cc:12:16: error: 'n' was not declared in this scope
   12 |   ll n; cin >> n;
      |                ^
a.cc:13:11: error: 'solve' was not declared in this scope
   13 |   cout << solve(n) << endl;
      |           ^~~~~
Language: C++

#include <iostream>

using namespace std;

ll solve(ll n)
{
  if (n == 1) return 1;
  return 2 * solve(n/2);
}

int main(int argc, char** argv) {
  ll n; cin >> n;
  cout << solve(n) << endl;
}

Compiler output:
a.cc:5:1: error: 'll' does not name a type
    5 | ll solve(ll n)
      | ^~
a.cc: In function 'int main(int, char**)':
a.cc:12:3: error: 'll' was not declared in this scope
   12 |   ll n; cin >> n;
      |   ^~
a.cc:12:16: error: 'n' was not declared in this scope
   12 |   ll n; cin >> n;
      |                ^
a.cc:13:11: error: 'solve' was not declared in this scope
   13 |   cout << solve(n) << endl;
      |           ^~~~~
Language: C++

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

int main()
{
	long long int s1, s2=1;
  
	cin>>s1;
  
    long long int sum;
  
    while(s2>0)
    {
        sum+=s2;
        s2*=2;
        s1=floor(s1/2);
    }
  
    cout<<sum<<endl;
  
    return 0;
}

Compiler output:
a.cc:2:17: error: 'etsd' is not a namespace-name
    2 | using namespace etsd;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |         cin>>s1;
      |         ^~~
      |         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:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |     cout<<sum<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |     cout<<sum<<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++

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

int main() {
    ll h;cin>>h;
    ll ans=0;
    ll num=1;
    while (h) {
        h/=2;
        ans+=num;
        num*=2
    }
    cout<<ans<<endl;
    return 0;
}

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

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

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define F first
#define S second
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
const int MOD = 1e9 + 7; 
const int N = 1e3+10; 

int main(void) 
{
	
	#ifndef ONLINE_JUDGE
	//freopen("input.txt", "r", stdin);
	#endif

	
	ll n; 
	cin >> n; 

	if (n==1) 
	{
		cout << 1 << '\n'; 
		return false; 
	}
	/* 
	 * number of leading zeros
	 * */
	ll b = 1LL < (63 - __builtin_clzll(n-1))<<'\n';
	cout << 2*b-1 <, '\n';


	return false;   


}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:24: error: expected primary-expression before ',' token
   59 |         cout << 2*b-1 <, '\n';
      |                        ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define VSORT(v) sort(v.begin(), v.end());
#define VREV(v) reverse(v.begin(), v.end());
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vdouble = vector<double>;

int gcd(int a, int b) {
    if (b==0) return a;
   	else return gcd(b, a%b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}


ll f(ll x){
	if(x==1) return 1;
	else return 2*f(x/2)+1
}
int main(){
	ll H;
	cin>>H;
	
	cout<<f(H)<<endl;
}
	

Compiler output:
a.cc: In function 'll f(ll)':
a.cc:22:31: error: expected ';' before '}' token
   22 |         else return 2*f(x/2)+1
      |                               ^
      |                               ;
   23 | }
      | ~
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
map<ll,ll> dp;
ll half(ll x)
{
  if(x<1)return 0;
  if(!dp[x]){
    dp[x] += 2*half(x/2);
   } 
    return dp[x];
} 
int main()
{
  ll h:
  cin>>h;
  cout<<half(h);
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: found ':' in nested-name-specifier, expected '::'
   15 |   ll h:
      |       ^
      |       ::
a.cc:15:6: error: 'h' has not been declared
   15 |   ll h:
      |      ^
a.cc:16:6: error: qualified-id in declaration before '>>' token
   16 |   cin>>h;
      |      ^~
a.cc:17:14: error: 'h' was not declared in this scope
   17 |   cout<<half(h);
      |              ^
Language: C++

#include<bits/stdc++.h>
#define ll long long

map<ll,ll> dp;
ll half(ll x)
{
  if(x<1)return 0;
  if(!dp[x]){
    dp[x] += 2*half(x/2);
   } 
    return dp[x];
} 

using namespace std;
int main()
{
  ll h:
  cin>>h;
  cout<<half(h);
} 

Compiler output:
a.cc:4:1: error: 'map' does not name a type
    4 | map<ll,ll> dp;
      | ^~~
a.cc: In function 'long long int half(long long int)':
a.cc:8:7: error: 'dp' was not declared in this scope; did you mean 'dup'?
    8 |   if(!dp[x]){
      |       ^~
      |       dup
a.cc:11:12: error: 'dp' was not declared in this scope; did you mean 'dup'?
   11 |     return dp[x];
      |            ^~
      |            dup
a.cc: In function 'int main()':
a.cc:17:7: error: found ':' in nested-name-specifier, expected '::'
   17 |   ll h:
      |       ^
      |       ::
a.cc:17:6: error: 'h' has not been declared
   17 |   ll h:
      |      ^
a.cc:18:6: error: qualified-id in declaration before '>>' token
   18 |   cin>>h;
      |      ^~
a.cc:19:14: error: 'h' was not declared in this scope
   19 |   cout<<half(h);
      |              ^
Language: C++

#include <iostream>
#include <queue>

int main(void){
  int H,count=0;
  // each vector represents the monsters
  std::queue<std::vector<int>> q;
  std::cin >> H;
  std::vector<int> v;
  v.push_back(H);
  q.push(v);
  
  //空になるまでやる
  while(q.size()){
    count++;
    //queueをポップ
    std::vector<int> mons = q.front();
    q.pop();
    //モンスターの数だけためす
    for(int i=0;i<mons.size();i++){
      std::vector<int> tmp = mons;
      //攻撃して倒す
      if(mons[i]==1){
        tmp.erase(i);
        //このとき全部倒したかを調べる
        if(!tmp.size()){
          //全部倒したら終わり
          std::cout << count << std::endl;
          return 0;
        }
        //まだ残っていないならqueueに追加
        q.push(tmp);
      //分裂した
      }else{
        int hp = (int)(mons[i]/2.0);
        //2体追加
        tmp.push_back(hp);
        tmp.push_back(hp);
        //queueにいれる
        q.push(tmp);
      }
    }
  }
  std::cout << count << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: no matching function for call to 'std::vector<int>::erase(int&)'
   24 |         tmp.erase(i);
      |         ~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/queue:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
#define FOR(i,l,r) for(size_t i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long

using namespace std;

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

  }


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

int main(){
  ll h,sum=0;
  while(h>0){
    sum+=(h);
    h/=2;
  }
  cout<<sum<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll h,sum=0;
      |   ^~
a.cc:6:9: error: 'h' was not declared in this scope
    6 |   while(h>0){
      |         ^
a.cc:7:5: error: 'sum' was not declared in this scope
    7 |     sum+=(h);
      |     ^~~
a.cc:10:9: error: 'sum' was not declared in this scope
   10 |   cout<<sum<<endl;
      |         ^~~
Language: C++

#include <iostream>
using namespace std;
 
int main() {
  ll a;
  int c, d;
  cin >> a;
  c = 1;
  d = 0;
  for (ll i = a; i >= 1; i /= 2){
    d += c;
    c *= 2;
  }
  cout << d << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll a;
      |   ^~
a.cc:7:10: error: 'a' was not declared in this scope
    7 |   cin >> a;
      |          ^
a.cc:10:10: error: expected ';' before 'i'
   10 |   for (ll i = a; i >= 1; i /= 2){
      |          ^~
      |          ;
a.cc:10:18: error: 'i' was not declared in this scope
   10 |   for (ll i = a; i >= 1; i /= 2){
      |                  ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int main() {
    int H, N=1;
    cin>>H;
  int i, x=1;
    for(i=0; >=H; i++){
        if(H<1){
            N=N*2;
            H=H/2;
            x+=2*i;
        }
        else if(H==1){
            x+=2*(i+1);
            cout<<x;
            return 0;
        }
    }
  // put your code here
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected primary-expression before '>=' token
    8 |     for(i=0; >=H; i++){
      |              ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll n;
      |   ^~
a.cc:8:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |   cin>>n;
      |        ^
      |        yn
a.cc:9:5: error: expected ';' before 'result'
    9 |   ll result = 1;
      |     ^~~~~~~
      |     ;
a.cc:10:10: error: 'result' was not declared in this scope
   10 |   while (result > n) {
      |          ^~~~~~
a.cc:13:9: error: 'result' was not declared in this scope
   13 |   cout<<result - 1<<endl;
      |         ^~~~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
  	ll n;
    cin>>n;
    ll b=1;
  	while(2*b<=n)b*=2
      cout<<2*b-1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected ';' before 'cout'
    9 |         while(2*b<=n)b*=2
      |                          ^
      |                          ;
   10 |       cout<<2*b-1<<endl;
      |       ~~~~
Language: C++

#include <iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
using namespace std;
int main()
{
	long long x, attacks = 0;
	cin >> x;
	if (x == 1)
		attacks++;
	else
	{
		long long log =log2(x)+1;
		attacks=pow(2,log)-1;
	}
	
	cout << attacks << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: 'log2' was not declared in this scope; did you mean 'log'?
   15 |                 long long log =log2(x)+1;
      |                                ^~~~
      |                                log
a.cc:16:25: error: 'pow' was not declared in this scope
   16 |                 attacks=pow(2,log)-1;
      |                         ^~~
Language: C++

int main() {
	long long x;
	int power=0;
	cin >> x;
	while (x>0)
	{
		power++;
		x=x>>1;
	}
	x=1;
	x=x<<power;
	x--;
	cout << x;
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long b = 1;
  while (2 * b <= n) b*= 2;
  count << 2 * b - 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: invalid operands of types '<unresolved overloaded function type>' and 'long long int' to binary 'operator<<'
   10 |   count << 2 * b - 1 << endl;
      |   ~~~~~~^~~~~~~~~~~~
Language: C++

using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long b = 1;
  while (2 * b <= n) b*= 2;
  count << 2 * b - 1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'ios_base' has not been declared
    3 |   ios_base::sync_with_stdio(false);
      |   ^~~~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin.tie(NULL);
      |   ^~~
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:4:11: error: 'NULL' was not declared in this scope
    4 |   cin.tie(NULL);
      |           ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | using namespace std;
a.cc:9:3: error: 'count' was not declared in this scope
    9 |   count << 2 * b - 1 << endl;
      |   ^~~~~
a.cc:9:25: error: 'endl' was not declared in this scope
    9 |   count << 2 * b - 1 << 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++

long long destroy(long long health) {
	if (health == 1) {
		return 1;
	}
	long long sum = 2 * destroy(health / 2) + 1;
	return sum;
}

int main(void) {
	long long monster_health = 0;
	std::cin >> monster_health;
	std::cout << destroy(monster_health) << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: 'cin' is not a member of 'std'
   11 |         std::cin >> monster_health;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | long long destroy(long long health) {
a.cc:12:14: error: 'cout' is not a member of 'std'
   12 |         std::cout << destroy(monster_health) << std::endl;
      |              ^~~~
a.cc:12:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:54: error: 'endl' is not a member of 'std'
   12 |         std::cout << destroy(monster_health) << std::endl;
      |                                                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | long long destroy(long long health) {
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll h;
  cin>>h;
  cout<<ll(pow(2,ll(log2(h))+1))-1
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:35: error: expected ';' before '}' token
    7 |   cout<<ll(pow(2,ll(log2(h))+1))-1
      |                                   ^
      |                                   ;
    8 | }
      | ~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
 
int main()
{
  long long h;
  cin>>h;
  long long b=1;
  while(2*b<=n)
    b*=2;
  cout<<2*b-1<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'n' was not declared in this scope
   10 |   while(2*b<=n)
      |              ^
Language: C++

#include<bits/stdc++.h>
#include<iostream>
using namespace std;
 
int main()
{
  long long h;
  cin>>h;
  long long b;
  while(2*b<=n)
    b*=2;
  cout<<2*b-1<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'n' was not declared in this scope
   10 |   while(2*b<=n)
      |              ^
Language: Java

import java.util.*;
public class Solution
{
  public static void main(String args[])
  {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int t = (int)Math.floor(Math.log(2*n)/Math.log(2));
    t = Math.pow(2,t);
    System.out.println(t-1);
  }
}
    


Compiler output:
Main.java:2: error: class Solution is public, should be declared in a file named Solution.java
public class Solution
       ^
Main.java:9: error: incompatible types: possible lossy conversion from double to int
    t = Math.pow(2,t);
                ^
2 errors
Language: Java

import java.util.*;
public class Solution
{
  public static void main(String args[])
  {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int t = Math.floor(Math.log(2*n)/Math.log(2));
    t = Math.pow(2,t);
    System.out.println(t-1);
  }
}
    

Compiler output:
Main.java:2: error: class Solution is public, should be declared in a file named Solution.java
public class Solution
       ^
Main.java:8: error: incompatible types: possible lossy conversion from double to int
    int t = Math.floor(Math.log(2*n)/Math.log(2));
                      ^
Main.java:9: error: incompatible types: possible lossy conversion from double to int
    t = Math.pow(2,t);
                ^
3 errors
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
long counter(long rest, long count){
	if(rest==1){
      return 1;
    }else{
      return counter((rest-(rest%2))/2, count)+1;
    }
}
int main(void){
  long h;
  long count = 0;
  cin >> h;
  count = counter(h, count);
  cout << (1-pow(2, count))/(1-2)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: expected ';' before '}' token
   16 |   cout << (1-pow(2, count))/(1-2)
      |                                  ^
      |                                  ;
   17 | }
      | ~
Language: C++

#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define ll long long
using namespace std;



int main(){

    int a,b   
    int H;
    cin >> H;

    if(H == 1){
        a = 1;
    }else if(1 < H){

        while(b == 1){
            
            b = H / 2;
            a ++;
        }

    }
    cout << a <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: expected initializer before 'int'
   35 |     int H;
      |     ^~~
a.cc:36:12: error: 'H' was not declared in this scope
   36 |     cin >> H;
      |            ^
a.cc:42:15: error: 'b' was not declared in this scope
   42 |         while(b == 1){
      |               ^
Language: Java

import java.util.*;
import java.io.*;
import java.lang.Math;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double h = sc.nextDouble();
    double attacks = 0;
    double temp =0;
    while(h>0){
      temp = 2*(h/2)+1;
    attacks+ = temp;
      
    }
    attacks = attacks-1;
    System.out.println(attacks);
  }
}
      
      


Compiler output:
Main.java:13: error: illegal start of expression
    attacks+ = temp;
             ^
1 error
Language: Java

import java.util.*;
import java.io.*;
import java.lang.Math;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double h = sc.nextDouble();
    double attacks = 0;
    while(h>0){
    attacks+ = 2*(h/2) + 1;
      h = h/2;
    }
    attacks = attacks-1;
    System.out.println(attacks);
  }
}
      
      


Compiler output:
Main.java:11: error: illegal start of expression
    attacks+ = 2*(h/2) + 1;
             ^
1 error
Language: Java

import java.util.*;
import java.io.*;
import java.lang.Math;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double h = sc.nextDouble();
    double attacks = 0;
    while(h){
    attacks = 2*h + 1;
      h = h/2;}
    System.out.println(attacks);
  }
}
      
      


Compiler output:
Main.java:10: error: incompatible types: double cannot be converted to boolean
    while(h){
          ^
1 error
Language: Java

import java.util.*;
import java.io.*;
import java.lang.Math;

class Main{
  static void cal(double h){
    double attacks = 0;
    attacks = 2*cal(h/2) + 1;
    System.out.println(attacks);
  }
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double h = sc.nextDouble();
    cal(h);
  }
}
      
      


Compiler output:
Main.java:8: error: 'void' type not allowed here
    attacks = 2*cal(h/2) + 1;
                   ^
1 error
Language: Java

import java.util.*;
import java.io.*;
import java.lang.Math;

class Main{
  void cal(double h){
    double attacks = 0;
    attacks = 2*cal(h/2) + 1;
    System.out.println(attacks);
  }
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double h = sc.nextDouble();
    cal(h);
  }
}
      
      


Compiler output:
Main.java:8: error: 'void' type not allowed here
    attacks = 2*cal(h/2) + 1;
                   ^
Main.java:14: error: non-static method cal(double) cannot be referenced from a static context
    cal(h);
    ^
2 errors
Language: Java

import java.util.*;
import java.io.*;
import java.lang.Math;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double h = sc.nextDouble();
    double attacks=0;;
    while(h>0)
      attacks=h*2;
      
    }
  attacks-=1;
    System.out.println(attacks);
  }
}
      
      


Compiler output:
Main.java:14: error: <identifier> expected
  attacks-=1;
         ^
Main.java:15: error: <identifier> expected
    System.out.println(attacks);
                      ^
Main.java:15: error: <identifier> expected
    System.out.println(attacks);
                              ^
Main.java:17: error: class, interface, enum, or record expected
}
^
4 errors
Language: Java

import java.util.*;
import java.io.*;
import java.lang.Math;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double h = sc.nextDouble();
    double attacks=0;;
    while(h>0)
      attacks=h*2;
      
    }
    System.out.println(attacks-1);
  }
}
      
      


Compiler output:
Main.java:14: error: <identifier> expected
    System.out.println(attacks-1);
                      ^
Main.java:14: error: <identifier> expected
    System.out.println(attacks-1);
                              ^
Main.java:16: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.util.*;
import java.io.*;
import java.lang.Math;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int attacks;
    if(h==1)
      System.out.println(0);
    else{
      attacks = (int)(Math.log(h)/Math.log(2));
      attacks*=2;
      attacks+=h-1;
    }
    System.out.println(attacks);
  }
}
      
      


Compiler output:
Main.java:17: error: variable attacks might not have been initialized
    System.out.println(attacks);
                       ^
1 error
Language: Java

import java.util.*;
import java.io.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int attacks;
    if(h==1)
      System.out.println(0);
    else{
      attacks = Math.log(h)/Math.log(2);
      attacks*=2;
      attacks+=h-1;
    }
    System.out.println(attacks);
  }
}
      
      

Compiler output:
Main.java:12: error: incompatible types: possible lossy conversion from double to int
      attacks = Math.log(h)/Math.log(2);
                           ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <string>
#define FIN freopen("inputs.txt", "r", stdin)
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
long long H;
int ans = 0;
int solve(long long arg){
//    cout<<"arg = "<<arg<<endl;
    if(arg == 1)
        return 1;
  	else if(arg == 0) return 0;
    else 
       return 1 + 2 * solve(arg/2);
    }
}
int main(){
//FIN;
    cin>>H;
    cout<<solve(H)<<endl;
    // cout<<ans<<endl;
    return 0;
}


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

#include <iostream>
#include <vector>
#include <string>
#define FIN freopen("inputs.txt", "r", stdin)
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
long long H;
int ans = 0;
int solve(long long arg){
//    cout<<"arg = "<<arg<<endl;
    if(arg == 1)
        return 1;
  	else if(arg == 0) return 0;
    else if{
       return 1 + 2 * solve(arg/2);
    }
}
int main(){
//FIN;
    cin>>H;
    cout<<solve(H)<<endl;
    // cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int solve(long long int)':
a.cc:15:12: error: expected '(' before '{' token
   15 |     else if{
      |            ^
      |            (
a.cc:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
Language: C

#include＜stdio.h＞ｃ

int main(){
 int h,a;
 scanf("%d",&h);
 
 for(int i=1;i>=0;i++){
  h=h/2;
  if(h==1){
   a=i+1;
   break;
  }
 }
 
 long ans=1;
 for(int i=1;i<=a;i++){
  ans*=2;
 }
 ans+=1;
 printf("%ld",ans);
 return 0;
}シャープinclude＜stdio.h＞ｃ

int main(){
 int h,a;
 scanf("%d",&h);
 
 for(int i=1;i>=0;i++){
  h=h/2;
  if(h==1){
   a=i+1;
   break;
  }
 }
 
 long ans=1;
 for(int i=1;i<=a;i++){
  ans*=2;
 }
 ans+=1;
 printf("%ld",ans);
 return 0;
}



Compiler output:
main.c:1:2: error: invalid preprocessing directive #include\U0000ff1cstdio
    1 | #include＜stdio.h＞ｃ
      |  ^~~~~~~~~~~~~~
main.c: In function 'main':
main.c:5:2: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |  scanf("%d",&h);
      |  ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #include＜stdio.h＞ｃ
main.c:5:2: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |  scanf("%d",&h);
      |  ^~~~~
main.c:5:2: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:20:2: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   20 |  printf("%ld",ans);
      |  ^~~~~~
main.c:20:2: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:2: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:20:2: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:22:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   22 | }シャープinclude＜stdio.h＞ｃ
      |                        ^
Language: C++

#include<bits/stdc++.h>
int main()
{
  int H;
  cin>>H;
  
  int cur=1;
  int ans=0;
  while(H)
  {
    H=floor(H/2);
    ans=ans+cur;
    cur=cur*2;
  }
  cout<<ans<<" "<<;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>H;
      |   ^~~
      |   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:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout<<ans<<" "<<;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:19: error: expected primary-expression before ';' token
   15 |   cout<<ans<<" "<<;
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
long long int h,c;
vector<long long int> v;
cin>>h;
v.push_back(h);
while(!v.empty()){
if(h<1)
  return 0;
else if(h==1)
{ c++;
 v.pop_back();
 }
 

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: expected '}' at end of input
   14 |  }
      |   ^
a.cc:8:18: note: to match this '{'
    8 | while(!v.empty()){
      |                  ^
a.cc:14:3: error: expected '}' at end of input
   14 |  }
      |   ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
long long int h,c;
vector<long long int> v;
cin>>h;
v.push_back(h);
while(!v.empty()){
if(h<1)
  return 0;
else if(h==1)
{ c++;
 v.pop();
 }

else{
v.pop();
h=h/2;
c=c+2;
v.push_back(h);
v.push_back(h);
  }}

cout<<c;  
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:4: error: 'class std::vector<long long int>' has no member named 'pop'
   13 |  v.pop();
      |    ^~~
a.cc:17:3: error: 'class std::vector<long long int>' has no member named 'pop'
   17 | v.pop();
      |   ^~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
long long int c=1,h=0,k=0,s=0,g=0;
cin>>h;
while(h>1)
{

  h=h/2;
  k++
}
cout<<k*k+2;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: expected ';' before '}' token
   11 |   k++
      |      ^
      |      ;
   12 | }
      | ~
Language: C++

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

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

#include <iostream>
#include <cmath>

int main() {
  std::cin >> h;
  long cnt = 0;
  while (h > 0) {
    h /= 2;
    ++cnt;
  }
  std::cout << std::pow(2, cnt-1) << std::endl;
  return 0;
}

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

#include"bits/stdc++.h"
// #include "prettyprint.hpp"

using namespace std;

typedef long long ll;



sys.setrecursionlimit(100000);

#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, n) for(ll i=n; i>=0; i--)
#define reps(i, s, e) for(ll i=s; i<e; i++)
#define all(x) x.begin(),x.end()

ll split(ll n){
	if(n > 1){
		return 2*split((ll)ceil(((double)n/2.0)) )+1;
	}

	else return  1;
}


int main(){
	ll H;

	cin >> H;

	cout << split(H) << endl;

	return 0;
}	


Compiler output:
a.cc:10:1: error: 'sys' does not name a type
   10 | sys.setrecursionlimit(100000);
      | ^~~
Language: Java

import java.util.*;
public class Main { 
    int cnt = 0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(helper(n));
    }

    private static void helper(int h) {
       cnt++;
       if(h == 1) {
            return;
       }
       helper(h/2); helper(h/2);
    }
}

Compiler output:
Main.java:7: error: 'void' type not allowed here
        System.out.println(helper(n));
                                 ^
Main.java:11: error: non-static variable cnt cannot be referenced from a static context
       cnt++;
       ^
2 errors
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define MAX 200005

using namespace std;
typedef unsigned long long ull;
typedef long long ll;


ll h, ans=0;

ll attack(ll hp){
  if(hp>1){
    ll ansr=ans;
    attack(hp/2);
    ans+=ans-ansr
  }
  ans++;
}

int main(){
  cin >> h;
  cout << attack(h) << endl;
  return 0;
}


Compiler output:
a.cc: In function 'll attack(ll)':
a.cc:17:18: error: expected ';' before '}' token
   17 |     ans+=ans-ansr
      |                  ^
      |                  ;
   18 |   }
      |   ~               
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
Language: Java

import java.util.*;  

public class Main {
	public static Long Ln(long x){
        if(x<=1){return x;                                         
                } else {return 2*Ln(x/2);                                                                                         
                       }                                                                                                
    }       
    public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		Long a = sc.nextLong();
        b = Ln(a);
		System.out.println(b);   
	}   
}



Compiler output:
Main.java:12: error: cannot find symbol
        b = Ln(a);
        ^
  symbol:   variable b
  location: class Main
Main.java:13: error: cannot find symbol
		System.out.println(b);   
		                   ^
  symbol:   variable b
  location: class Main
2 errors
Language: Java

import java.util.*;  

public class Main {
	public static Long Ln(long x){
        if(x<=1){return x;                                         
                } else {return 2*Ln(x/2);                                                                                         
                       }                                                                                                
    }       
    public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		Long a = sc.nextLong();
        b = L(a);
		System.out.println(b);   
	}   
}



Compiler output:
Main.java:12: error: cannot find symbol
        b = L(a);
        ^
  symbol:   variable b
  location: class Main
Main.java:12: error: cannot find symbol
        b = L(a);
            ^
  symbol:   method L(Long)
  location: class Main
Main.java:13: error: cannot find symbol
		System.out.println(b);   
		                   ^
  symbol:   variable b
  location: class Main
3 errors